diff options
author | Rajesh Kemisetti <rajeshk@codeaurora.org> | 2017-06-29 18:48:11 +0530 |
---|---|---|
committer | Rajesh Kemisetti <rajeshk@codeaurora.org> | 2017-06-30 18:55:28 +0530 |
commit | a92d182205df6877c29b4a2e1760b6f43fec1d2f (patch) | |
tree | 54501911c644e4831c88ebbaaeb00244576e2941 /drivers/gpu/msm/kgsl_pwrctrl.c | |
parent | f2485229cd9ad26e8d8e0b3dd72bbc0dc08b6d9c (diff) |
msm: kgsl: Make sure regulators are ON before GPU clocks are forced on
The debug option to always ON the GPU clocks does not check the regulator
state. If the user tries to set this option while GPU is in Slumber state
then enabling clocks will fail.
Make sure we enable the GPU regulators before enabling its clocks.
Change-Id: Id77773224c674fe2e1b6179a039750b24e5e5f87
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_pwrctrl.c')
-rw-r--r-- | drivers/gpu/msm/kgsl_pwrctrl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c index e42f92392e8d..4162fa61f51a 100644 --- a/drivers/gpu/msm/kgsl_pwrctrl.c +++ b/drivers/gpu/msm/kgsl_pwrctrl.c @@ -1022,6 +1022,8 @@ static void __force_on(struct kgsl_device *device, int flag, int on) if (on) { switch (flag) { case KGSL_PWRFLAGS_CLK_ON: + /* make sure pwrrail is ON before enabling clocks */ + kgsl_pwrctrl_pwrrail(device, KGSL_PWRFLAGS_ON); kgsl_pwrctrl_clk(device, KGSL_PWRFLAGS_ON, KGSL_STATE_ACTIVE); break; @@ -1817,7 +1819,12 @@ static int kgsl_pwrctrl_pwrrail(struct kgsl_device *device, int state) struct kgsl_pwrctrl *pwr = &device->pwrctrl; int status = 0; - if (test_bit(KGSL_PWRFLAGS_POWER_ON, &pwr->ctrl_flags)) + /* + * Disabling the regulator means also disabling dependent clocks. + * Hence don't disable it if force clock ON is set. + */ + if (test_bit(KGSL_PWRFLAGS_POWER_ON, &pwr->ctrl_flags) || + test_bit(KGSL_PWRFLAGS_CLK_ON, &pwr->ctrl_flags)) return 0; if (state == KGSL_PWRFLAGS_OFF) { |