aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2014-08-05 08:43:10 -0400
committerOlof Johansson <olof@lixom.net>2014-08-09 11:24:36 -0400
commit01601b349582caa617618b5fa7d9b08bd328626a (patch)
tree6d14f91842c5e9a49f257b38be94d5dbb647f7b5 /drivers/cpuidle
parentbb7aedff3f98c5b842f787f70d99370da197f76b (diff)
ARM: EXYNOS: Fix suspend/resume sequences
Due to recent consolidation of Exynos suspend and cpuidle code, some parts of suspend and resume sequences are executed two times, once from exynos_pm_syscore_ops and then from exynos_cpu_pm_notifier() and thus it breaks suspend, at least on Exynos4-based boards. In addition, simple core power down from a cpuidle driver could, in case of CPU 0 could result in calling functions that are specific to suspend and deeper idle states. This patch fixes the issue by moving those operations outside the CPU PM notifier into suspend and AFTR code paths. This leads to a bit of code duplication, but allows additional code simplification, so in the end more code is removed than added. Fixes: 85f9f90808b4 ("ARM: EXYNOS: Use the cpu_pm notifier for pm") Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Olof Johansson <olof@lixom.net> Cc: arm@kernel.org Signed-off-by: Tomasz Figa <t.figa@samsung.com> [b.zolnierkie: ported patch over current changes] [b.zolnierkie: fixed exynos_aftr_finisher() return value] Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle-exynos.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/cpuidle/cpuidle-exynos.c b/drivers/cpuidle/cpuidle-exynos.c
index 7c0151263828..ba9b34b579f3 100644
--- a/drivers/cpuidle/cpuidle-exynos.c
+++ b/drivers/cpuidle/cpuidle-exynos.c
@@ -20,25 +20,6 @@
20 20
21static void (*exynos_enter_aftr)(void); 21static void (*exynos_enter_aftr)(void);
22 22
23static int idle_finisher(unsigned long flags)
24{
25 exynos_enter_aftr();
26 cpu_do_idle();
27
28 return 1;
29}
30
31static int exynos_enter_core0_aftr(struct cpuidle_device *dev,
32 struct cpuidle_driver *drv,
33 int index)
34{
35 cpu_pm_enter();
36 cpu_suspend(0, idle_finisher);
37 cpu_pm_exit();
38
39 return index;
40}
41
42static int exynos_enter_lowpower(struct cpuidle_device *dev, 23static int exynos_enter_lowpower(struct cpuidle_device *dev,
43 struct cpuidle_driver *drv, 24 struct cpuidle_driver *drv,
44 int index) 25 int index)
@@ -51,8 +32,10 @@ static int exynos_enter_lowpower(struct cpuidle_device *dev,
51 32
52 if (new_index == 0) 33 if (new_index == 0)
53 return arm_cpuidle_simple_enter(dev, drv, new_index); 34 return arm_cpuidle_simple_enter(dev, drv, new_index);
54 else 35
55 return exynos_enter_core0_aftr(dev, drv, new_index); 36 exynos_enter_aftr();
37
38 return new_index;
56} 39}
57 40
58static struct cpuidle_driver exynos_idle_driver = { 41static struct cpuidle_driver exynos_idle_driver = {