Revert "msm: pm-8x60: Don't save or restore GIC,VFP state in power collapse"
Save and restore of GIC and VFP state is required to avoid subtle
userspace crashes due to corrupted state across power-collapse
This reverts commit a291d8a5596ba23ed3c03629ae50169443dd6159.
CRs-Fixed: 550405
Change-Id: I1ebe5666dc858116ddc5b830d706e3dacbb16cbe
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/pm-8x60.c b/arch/arm/mach-msm/pm-8x60.c
index da5e67a..00b0b3b 100644
--- a/arch/arm/mach-msm/pm-8x60.c
+++ b/arch/arm/mach-msm/pm-8x60.c
@@ -481,6 +481,10 @@
bool collapsed = 0;
int ret;
bool save_cpu_regs = !cpu || from_idle;
+ unsigned int saved_gic_cpu_ctrl;
+
+ saved_gic_cpu_ctrl = readl_relaxed(MSM_QGIC_CPU_BASE + GIC_CPU_CTRL);
+ mb();
if (MSM_PM_DEBUG_POWER_COLLAPSE & msm_pm_debug_mask)
pr_info("CPU%u: %s: notify_rpm %d\n",
@@ -503,6 +507,9 @@
if (from_idle && msm_pm_pc_reset_timer)
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
+#ifdef CONFIG_VFP
+ vfp_pm_suspend();
+#endif
collapsed = save_cpu_regs ? msm_pm_collapse() : msm_pm_pc_hotplug();
if (from_idle && msm_pm_pc_reset_timer)
@@ -511,7 +518,14 @@
msm_pm_boot_config_after_pc(cpu);
if (collapsed) {
+#ifdef CONFIG_VFP
+ vfp_pm_resume();
+#endif
cpu_init();
+ writel(0xF0, MSM_QGIC_CPU_BASE + GIC_CPU_PRIMASK);
+ writel_relaxed(saved_gic_cpu_ctrl,
+ MSM_QGIC_CPU_BASE + GIC_CPU_CTRL);
+ mb();
local_fiq_enable();
}