From: Santosh Shilimkar Date: Sat, 3 Sep 2011 17:08:27 +0000 (+0530) Subject: ARM: OMAP3: CPUidle: Make use of CPU PM notifiers X-Git-Tag: sz_161~39 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=ea8ba7659d16d45f4fa6ec214c6a6c63eb7cb5e1;hp=b54eabb8bfb144cdfceb3a56d09d2f2dfd8725d5 ARM: OMAP3: CPUidle: Make use of CPU PM notifiers Save VFP CPU context using CPU PM notifier chain. VFP context is lost when CPU hits OFF state. Signed-off-by: Santosh Shilimkar Reviewed-by: Kevin Hilman Tested-by: Vishwanath BS Signed-off-by: Kevin Hilman --- diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 1f34914f6754..e8e8d39a711d 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -108,9 +109,23 @@ static int omap3_enter_idle(struct cpuidle_device *dev, clkdm_deny_idle(core_pd->pwrdm_clkdms[0]); } + /* + * 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 (index == 0) { clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);