Save VFP CPU context using CPU PM notifier chain. VFP context
is lost when CPU hits OFF state.

Signed-off-by: Santosh Shilimkar <santosh.shilim...@ti.com>
Reviewed-by: Kevin Hilman <khil...@ti.com>
Tested-by: Vishwanath BS <vishwanath...@ti.com>
---
 arch/arm/mach-omap2/cpuidle34xx.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c 
b/arch/arm/mach-omap2/cpuidle34xx.c
index 4bf6e6e..861920a 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -24,6 +24,7 @@
 
 #include <linux/sched.h>
 #include <linux/cpuidle.h>
+#include <linux/cpu_pm.h>
 
 #include <plat/prcm.h>
 #include <plat/irqs.h>
@@ -118,9 +119,23 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
                pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
        }
 
+       /*
+        * Call idle CPU PM enter notifier chain so that
+        * VFP context is saved.
+        */
+       if (mpu_state == PWRDM_POWER_OFF)
+               cpu_pm_enter();
+
        /* Execute ARM wfi */
        omap_sram_idle();
 
+       /*
+        * Call idle CPU PM enter notifier chain to restore
+        * VFP context.
+        */
+       if (pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
+               cpu_pm_exit();
+
        /* Re-allow idle for C1 */
        if (state == &dev->states[0]) {
                pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to