summaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-01-15 23:17:00 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:58 -0500
commitb28f508112c584cdfbb4d8a9489cc4b79dac68ee (patch)
tree8269d53055d0368f6eb25fac6b9d29077382cbca /kernel/power
parentc9b6c8f68ee48e1e3dbb53e13316757e2c0b584d (diff)
downloadlinux-b28f508112c584cdfbb4d8a9489cc4b79dac68ee.tar.gz
linux-b28f508112c584cdfbb4d8a9489cc4b79dac68ee.tar.bz2
linux-b28f508112c584cdfbb4d8a9489cc4b79dac68ee.zip
Suspend: Add config option to disable the freezer if architecture wants that
This patch makes the freezer optional for suspend to allow the system to work (or not work) like the original PMU suspend. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/power')
-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
powered and thus its contents are preserved, such as the
suspend-to-RAM state (e.g. the ACPI S3 state).
+config SUSPEND_FREEZER
+ bool "Enable freezer for suspend to RAM/standby" \
+ if ARCH_WANTS_FREEZER_CONTROL || BROKEN
+ depends on SUSPEND
+ default y
+ help
+ This allows you to turn off the freezer for suspend. If this is
+ done, no tasks are frozen for suspend to RAM/standby.
+
+ Turning OFF this setting is NOT recommended! If in doubt, say Y.
+
config HIBERNATION
bool "Hibernation (aka 'suspend to disk')"
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)
pm_prepare_console();
- if (freeze_processes()) {
+ if (suspend_freeze_processes()) {
error = -EAGAIN;
goto Thaw;
}
@@ -199,7 +199,7 @@ static int suspend_prepare(void)
return 0;
Thaw:
- thaw_processes();
+ suspend_thaw_processes();
pm_restore_console();
Finish:
pm_notifier_call_chain(PM_POST_SUSPEND);
@@ -308,7 +308,7 @@ int suspend_devices_and_enter(suspend_state_t state)
*/
static void suspend_finish(void)
{
- thaw_processes();
+ suspend_thaw_processes();
pm_restore_console();
pm_notifier_call_chain(PM_POST_SUSPEND);
}
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 @@
#include <linux/suspend.h>
#include <linux/suspend_ioctls.h>
#include <linux/utsname.h>
+#include <linux/freezer.h>
struct swsusp_info {
struct new_utsname uts;
@@ -203,3 +204,24 @@ enum {
#define TEST_MAX (__TEST_AFTER_LAST - 1)
extern int pm_test_level;
+
+#ifdef CONFIG_SUSPEND_FREEZER
+static inline int suspend_freeze_processes(void)
+{
+ return freeze_processes();
+}
+
+static inline void suspend_thaw_processes(void)
+{
+ thaw_processes();
+}
+#else
+static inline int suspend_freeze_processes(void)
+{
+ return 0;
+}
+
+static inline void suspend_thaw_processes(void)
+{
+}
+#endif