msm: kgsl: Skip state change in idle check, if requested state is NONE

After scheduling the idle work for transitioning to either NAP or SLUMBER
it's possible that requested state can change to NONE if any new workload
comes before kgsl_idle_check is executed or it gets the device mutex.
If this happens, current code calls pwrctrl_change_state which fails as
this is not a valid transition. To prevent this, skip calling
pwrctrl_change_state if requested state is NONE.

Change-Id: Iae535c6e2a3230f9e7e210712990eeb405822f4f
Signed-off-by: Deepak Kumar <dkumar@codeaurora.org>
Signed-off-by: Pankaj Gupta <gpankaj@codeaurora.org>
This commit is contained in:
Pankaj Gupta 2020-09-02 10:57:31 +05:30
commit 50379951c4

View file

@ -1601,6 +1601,18 @@ void kgsl_idle_check(struct work_struct *work)
mutex_lock(&device->mutex);
/*
* After scheduling idle work for transitioning to either NAP or
* SLUMBER, it's possible that requested state can change to NONE
* if any new workload comes before kgsl_idle_check is executed or
* it gets the device mutex. In such case, no need to change state
* to NONE.
*/
if (device->requested_state == KGSL_STATE_NONE) {
mutex_unlock(&device->mutex);
return;
}
requested_state = device->requested_state;
if (device->state == KGSL_STATE_ACTIVE