msm: pm-8x60: Check for SPM status in msm_pm_verify_cpu_pc
Verify that SPM is in sleep mode in msm_pm_verify_cpu_pc. If not, it is
possible that msm_pm_wait_cpu_shutdown could fail but acpuclock would
turn off the clocks based on the the return value of
msm_pm_verify_cpu_pc.
CRs-fixed: 376791
Change-Id: Id55019508ea9bc27106eb298e19988aecc055cac
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/pm-8x60.c b/arch/arm/mach-msm/pm-8x60.c
index 15a0b6a..6e86baa 100644
--- a/arch/arm/mach-msm/pm-8x60.c
+++ b/arch/arm/mach-msm/pm-8x60.c
@@ -808,10 +808,15 @@
{
enum msm_pm_sleep_mode mode = per_cpu(msm_pm_last_slp_mode, cpu);
- if (msm_pm_slp_sts)
- if ((mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE) ||
- (mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE))
+ if (msm_pm_slp_sts) {
+ int acc_sts = __raw_readl(msm_pm_slp_sts->base_addr
+ + cpu * msm_pm_slp_sts->cpu_offset);
+
+ if ((acc_sts & msm_pm_slp_sts->mask) &&
+ ((mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE) ||
+ (mode == MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)))
return true;
+ }
return false;
}