msm: spm: Do not prevent writing zero to SPM address offset.
The current driver programs the Krait SPM to reset the start address
register after a successful completion of a low power mode
sequence. Based on the above assumption, the driver doesn't write a zero
to the sequence start address. The clock gating power mode is programmed
at the zeroth offset of the command sequence, therefore minimizing the
enter and exit latency of clock gating mode.
During idle power collapse, an interrupt could be pending when the Krait
executes a WFI. This causes Krait to return from WFI without SPM executing
the programmed low power modes. Thereby, when Krait executes a WFI
during clock gating SPM executes the Power collapse mode previously
programmed. This results in the idle thread's stack pointer being
corrupted when Krait resumes through the warmboot path.
Signed-off-by: Maheshkumar Sivasubramanian <msivasub@codeaurora.org>
diff --git a/arch/arm/mach-msm/spm-v2.c b/arch/arm/mach-msm/spm-v2.c
index 46d6eb31..4a7cf91 100644
--- a/arch/arm/mach-msm/spm-v2.c
+++ b/arch/arm/mach-msm/spm-v2.c
@@ -208,10 +208,8 @@
msm_spm_drv_set_start_addr(dev, addr);
- if (addr) {
- msm_spm_drv_flush_shadow(dev, MSM_SPM_REG_SAW2_SPM_CTL);
- wmb();
- }
+ msm_spm_drv_flush_shadow(dev, MSM_SPM_REG_SAW2_SPM_CTL);
+ wmb();
if (msm_spm_debug_mask & MSM_SPM_DEBUG_SHADOW) {
int i;