Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 463e5f5e authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Use GPU power registers to check GX status



GPU GX ON status is available in the GPU power registers.
So make use of GPU power registers to check GX power ON
status in GPU fault recovery.

Change-Id: I8652bd332aadbeac8cb18adea733fedc0868e6aa
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent a7220f4d
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2018,2020 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -2271,8 +2271,7 @@ static int a6xx_complete_rpmh_votes(struct kgsl_device *device)

static int a6xx_gmu_suspend(struct kgsl_device *device)
{
	/* Max GX clients on A6xx is 2: GMU and KMD */
	int ret = 0, max_client_num = 2;
	int ret = 0;
	struct gmu_device *gmu = &device->gmu;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);

@@ -2292,7 +2291,7 @@ static int a6xx_gmu_suspend(struct kgsl_device *device)
	a6xx_complete_rpmh_votes(device);

	if (gmu->gx_gdsc) {
		if (regulator_is_enabled(gmu->gx_gdsc)) {
		if (a6xx_gx_is_on(adreno_dev)) {
			/* Switch gx gdsc control from GMU to CPU
			 * force non-zero reference count in clk driver
			 * so next disable call will turn
@@ -2301,18 +2300,16 @@ static int a6xx_gmu_suspend(struct kgsl_device *device)
			ret = regulator_enable(gmu->gx_gdsc);
			if (ret)
				dev_err(&gmu->pdev->dev,
					"suspend fail: gx enable\n");
					"suspend fail: gx enable %d\n", ret);

			while ((max_client_num)) {
			ret = regulator_disable(gmu->gx_gdsc);
				if (!regulator_is_enabled(gmu->gx_gdsc))
					break;
				max_client_num -= 1;
			}
			if (ret)
				dev_err(&gmu->pdev->dev,
					"suspend fail: gx disable %d\n", ret);

			if (!max_client_num)
			if (a6xx_gx_is_on(adreno_dev))
				dev_err(&gmu->pdev->dev,
					"suspend fail: cannot disable gx\n");
					"suspend fail: gx is stuck on\n");
		}
	}