From f2af78b73d86543b5a60fd30410f7828f94d90ff Mon Sep 17 00:00:00 2001 From: Hareesh Gundu Date: Thu, 20 Aug 2020 12:30:09 +0530 Subject: [PATCH] msm: kgsl: Save and restore the power ctrl_flags during recovery MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Power ctrl_flags will prevent the GPU power collapse when the user has overwritten the force_rail_on, force_clk_on etc. This will result into GPU wakeup problems in case power collapse hasn’t happened during the hang recovery. Change-Id: Ib1e86bbb70b2b71b8f8820692d13ce3ab6200db0 Signed-off-by: Hareesh Gundu --- drivers/gpu/msm/adreno_a6xx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/msm/adreno_a6xx.c b/drivers/gpu/msm/adreno_a6xx.c index f274b7fca891..243f61f87564 100644 --- a/drivers/gpu/msm/adreno_a6xx.c +++ b/drivers/gpu/msm/adreno_a6xx.c @@ -1166,6 +1166,10 @@ static int a6xx_reset(struct kgsl_device *device) { struct adreno_device *adreno_dev = ADRENO_DEVICE(device); int ret; + unsigned long flags = device->pwrctrl.ctrl_flags; + + /* Clear ctrl_flags to ensure clocks and regulators are turned off */ + device->pwrctrl.ctrl_flags = 0; kgsl_pwrctrl_change_state(device, KGSL_STATE_INIT); @@ -1178,6 +1182,8 @@ static int a6xx_reset(struct kgsl_device *device) kgsl_pwrctrl_change_state(device, KGSL_STATE_ACTIVE); + device->pwrctrl.ctrl_flags = flags; + /* Toggle GX CPR on demand */ a6xx_gx_cpr_toggle(device);