Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge "msm: kgsl: Save and restore the power ctrl_flags during recovery"
Browse files Browse the repository at this point in the history
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Sep 11, 2020
2 parents 1ea919c + e562c60 commit da2a024
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/gpu/msm/adreno.c
Original file line number Diff line number Diff line change
Expand Up @@ -2477,6 +2477,14 @@ int adreno_reset(struct kgsl_device *device, int fault)
}
}
if (ret) {
unsigned long flags = device->pwrctrl.ctrl_flags;

/*
* Clear ctrl_flags to ensure clocks and regulators are
* turned off
*/
device->pwrctrl.ctrl_flags = 0;

/* If soft reset failed/skipped, then pull the power */
kgsl_pwrctrl_change_state(device, KGSL_STATE_INIT);
/* since device is officially off now clear start bit */
Expand All @@ -2494,6 +2502,8 @@ int adreno_reset(struct kgsl_device *device, int fault)
break;
}
}

device->pwrctrl.ctrl_flags = flags;
}
if (ret)
return ret;
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/msm/adreno_a6xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1136,11 +1136,15 @@ static int a6xx_reset(struct kgsl_device *device, int fault)
{
struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
int ret;
unsigned long flags = device->pwrctrl.ctrl_flags;

/* Use the regular reset sequence for No GMU */
if (!gmu_core_isenabled(device))
return adreno_reset(device, fault);

/* Clear ctrl_flags to ensure clocks and regulators are turned off */
device->pwrctrl.ctrl_flags = 0;

/* Transition from ACTIVE to RESET state */
kgsl_pwrctrl_change_state(device, KGSL_STATE_RESET);

Expand All @@ -1153,6 +1157,8 @@ static int a6xx_reset(struct kgsl_device *device, int fault)

kgsl_pwrctrl_change_state(device, KGSL_STATE_ACTIVE);

device->pwrctrl.ctrl_flags = flags;

/*
* If active_cnt is zero, there is no need to keep the GPU active. So,
* we should transition to SLUMBER.
Expand Down

0 comments on commit da2a024

Please sign in to comment.