From: Rafael J. Wysocki Date: Sun, 20 Apr 2014 21:43:01 +0000 (+0200) Subject: PM / suspend: Make cpuidle work in the "freeze" state X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f3f125324fc1b8500cd20a2907628f7e5d88a708;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git PM / suspend: Make cpuidle work in the "freeze" state The "freeze" system sleep state introduced by commit 7e73c5ae6e79 (PM: Introduce suspend state PM_SUSPEND_FREEZE) requires cpuidle to be functional when freeze_enter() is executed to work correctly (that is, to be able to save any more energy than runtime idle), but that is impossible after commit 8651f97bd951d (PM / cpuidle: System resume hang fix with cpuidle) which caused cpuidle to be paused in dpm_suspend_noirq() and resumed in dpm_resume_noirq(). To avoid that problem, add cpuidle_resume() and cpuidle_pause() to the beginning and the end of freeze_enter(), respectively. Reported-by: Zhang Rui Signed-off-by: Rafael J. Wysocki Reviewed-by: Preeti U Murthy --- diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index c3ad9cafe930..8233cd4047d7 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +54,9 @@ static void freeze_begin(void) static void freeze_enter(void) { + cpuidle_resume(); wait_event(suspend_freeze_wait_head, suspend_freeze_wake); + cpuidle_pause(); } void freeze_wake(void)