msm: kgsl: Use the requested state in kgsl_pwrctrl_change_state
In kgsl_pwrctrl_change_state() the state is passed to
kgsl_pwrctrl_request_state() which has the sole purpose of setting
device->requested_state which is then queried in a case statement
inside of kgsl_pwrctrl_change_state() and power things happen.
As it happens device->requested_state is also modified by idle_timer
which runs without mutexes so there is a brief but clear window of
pain wherein the requested_state could be overwritten by the idle
timer after the requested state was set by kgsl_pwrctrl_change_state
but before it was queried in the case statement.
None of this is needed. kgsl_pwrctrl_change_state is intended to
change the state to the passed in state so there is no need to
tempt fate by trying to set the global variable and then query it.
Use the passed in state for the case statement and do what it says.
If some other non-mutexed entity such as the idle_timer happens
to modify the requested_state in the meantime it will get ignored
as it should be.
CRS-Fixed: 703350
Change-Id: Ic0dedbad9ea9a9783d0cfd3b23d83496756aaa79
Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
Loading
Please register or sign in to comment