diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-20 17:43:01 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-21 17:39:59 -0400 |
commit | f3f125324fc1b8500cd20a2907628f7e5d88a708 (patch) | |
tree | 7ce0e8e3fd0b7cbd151540a5c87e44a37e3a54b4 /kernel | |
parent | a798c10faf62a505d24e5f6213fbaf904a39623f (diff) |
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 <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/suspend.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 @@ | |||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/console.h> | 15 | #include <linux/console.h> |
16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
17 | #include <linux/cpuidle.h> | ||
17 | #include <linux/syscalls.h> | 18 | #include <linux/syscalls.h> |
18 | #include <linux/gfp.h> | 19 | #include <linux/gfp.h> |
19 | #include <linux/io.h> | 20 | #include <linux/io.h> |
@@ -53,7 +54,9 @@ static void freeze_begin(void) | |||
53 | 54 | ||
54 | static void freeze_enter(void) | 55 | static void freeze_enter(void) |
55 | { | 56 | { |
57 | cpuidle_resume(); | ||
56 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); | 58 | wait_event(suspend_freeze_wait_head, suspend_freeze_wake); |
59 | cpuidle_pause(); | ||
57 | } | 60 | } |
58 | 61 | ||
59 | void freeze_wake(void) | 62 | void freeze_wake(void) |