From c426a2fdfd6caff7ef2cd4fd5d54cf8e7a5b6ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Neum=C3=BCller?= Date: Sat, 20 Dec 2014 23:59:48 +0100 Subject: ARM: Exynos: Call cpu_pm_enter/exit in Low Power States. In low power cpuidle states, the FPU registers get corrupted. By calling cpu_pm_enter, the VFP module gets notified so that it saves the FPU state and restores it from RAM the next time a thread uses it. The comments at cpu_pm_enter/exit indicate that these functions must be called with interrupts disabled, so place the calls between local_irq_disable/local_irq_enble. See http://forum.xda-developers.com/showthread.php?p=57637134 to http://forum.xda-developers.com/showthread.php?p=57643086. Change-Id: Icde0ab93734cf2a4febfabc3c04e77ce955bd9da --- arch/arm/mach-exynos/cpuidle-exynos4.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm/mach-exynos/cpuidle-exynos4.c b/arch/arm/mach-exynos/cpuidle-exynos4.c index 2fd7953..88b941f 100644 --- a/arch/arm/mach-exynos/cpuidle-exynos4.c +++ b/arch/arm/mach-exynos/cpuidle-exynos4.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -568,6 +569,8 @@ static int exynos4_enter_core0_aftr(struct cpuidle_device *dev, local_irq_disable(); + cpu_pm_enter(); + if (log_en) pr_info("+++aftr\n"); @@ -630,6 +633,8 @@ early_wakeup: if (log_en) pr_info("---aftr\n"); + cpu_pm_exit(); + local_irq_enable(); idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + (after.tv_usec - before.tv_usec); @@ -663,6 +668,8 @@ static int exynos4_enter_core0_lpa(struct cpuidle_device *dev, #endif local_irq_disable(); + cpu_pm_enter(); + #if defined(CONFIG_INTERNAL_MODEM_IF) || defined(CONFIG_SAMSUNG_PHONE_TTY) gpio_set_value(GPIO_PDA_ACTIVE, 0); #endif @@ -763,6 +770,8 @@ early_wakeup: gpio_set_value(GPIO_PDA_ACTIVE, 1); #endif + cpu_pm_exit(); + local_irq_enable(); idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + (after.tv_usec - before.tv_usec); -- cgit v1.1