aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/Kconfig11
-rw-r--r--kernel/power/main.c6
-rw-r--r--kernel/power/power.h22
3 files changed, 36 insertions, 3 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index f8153fda06bb..ef9b802738a5 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -104,6 +104,17 @@ config SUSPEND
104 powered and thus its contents are preserved, such as the 104 powered and thus its contents are preserved, such as the
105 suspend-to-RAM state (e.g. the ACPI S3 state). 105 suspend-to-RAM state (e.g. the ACPI S3 state).
106 106
107config SUSPEND_FREEZER
108 bool "Enable freezer for suspend to RAM/standby" \
109 if ARCH_WANTS_FREEZER_CONTROL || BROKEN
110 depends on SUSPEND
111 default y
112 help
113 This allows you to turn off the freezer for suspend. If this is
114 done, no tasks are frozen for suspend to RAM/standby.
115
116 Turning OFF this setting is NOT recommended! If in doubt, say Y.
117
107config HIBERNATION 118config HIBERNATION
108 bool "Hibernation (aka 'suspend to disk')" 119 bool "Hibernation (aka 'suspend to disk')"
109 depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE 120 depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
diff --git a/kernel/power/main.c b/kernel/power/main.c
index d9bba452764b..e47214cfeb2d 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -181,7 +181,7 @@ static int suspend_prepare(void)
181 181
182 pm_prepare_console(); 182 pm_prepare_console();
183 183
184 if (freeze_processes()) { 184 if (suspend_freeze_processes()) {
185 error = -EAGAIN; 185 error = -EAGAIN;
186 goto Thaw; 186 goto Thaw;
187 } 187 }
@@ -199,7 +199,7 @@ static int suspend_prepare(void)
199 return 0; 199 return 0;
200 200
201 Thaw: 201 Thaw:
202 thaw_processes(); 202 suspend_thaw_processes();
203 pm_restore_console(); 203 pm_restore_console();
204 Finish: 204 Finish:
205 pm_notifier_call_chain(PM_POST_SUSPEND); 205 pm_notifier_call_chain(PM_POST_SUSPEND);
@@ -308,7 +308,7 @@ int suspend_devices_and_enter(suspend_state_t state)
308 */ 308 */
309static void suspend_finish(void) 309static void suspend_finish(void)
310{ 310{
311 thaw_processes(); 311 suspend_thaw_processes();
312 pm_restore_console(); 312 pm_restore_console();
313 pm_notifier_call_chain(PM_POST_SUSPEND); 313 pm_notifier_call_chain(PM_POST_SUSPEND);
314} 314}
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 8ec5499c5ce1..700f44ec8406 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -1,6 +1,7 @@
1#include <linux/suspend.h> 1#include <linux/suspend.h>
2#include <linux/suspend_ioctls.h> 2#include <linux/suspend_ioctls.h>
3#include <linux/utsname.h> 3#include <linux/utsname.h>
4#include <linux/freezer.h>
4 5
5struct swsusp_info { 6struct swsusp_info {
6 struct new_utsname uts; 7 struct new_utsname uts;
@@ -203,3 +204,24 @@ enum {
203#define TEST_MAX (__TEST_AFTER_LAST - 1) 204#define TEST_MAX (__TEST_AFTER_LAST - 1)
204 205
205extern int pm_test_level; 206extern int pm_test_level;
207
208#ifdef CONFIG_SUSPEND_FREEZER
209static inline int suspend_freeze_processes(void)
210{
211 return freeze_processes();
212}
213
214static inline void suspend_thaw_processes(void)
215{
216 thaw_processes();
217}
218#else
219static inline int suspend_freeze_processes(void)
220{
221 return 0;
222}
223
224static inline void suspend_thaw_processes(void)
225{
226}
227#endif