Commit b28f5081 authored by Johannes Berg's avatar Johannes Berg Committed by Len Brown

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: default avatarJohannes Berg <johannes@sipsolutions.net>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c9b6c8f6
...@@ -405,6 +405,10 @@ config CMDLINE ...@@ -405,6 +405,10 @@ config CMDLINE
most cases you will need to specify the root device here. most cases you will need to specify the root device here.
if !44x || BROKEN if !44x || BROKEN
config ARCH_WANTS_FREEZER_CONTROL
def_bool y
depends on ADB_PMU
source kernel/power/Kconfig source kernel/power/Kconfig
endif endif
......
...@@ -104,6 +104,17 @@ config SUSPEND ...@@ -104,6 +104,17 @@ config SUSPEND
powered and thus its contents are preserved, such as the powered and thus its contents are preserved, such as the
suspend-to-RAM state (e.g. the ACPI S3 state). 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 config HIBERNATION
bool "Hibernation (aka 'suspend to disk')" bool "Hibernation (aka 'suspend to disk')"
depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
......
...@@ -181,7 +181,7 @@ static int suspend_prepare(void) ...@@ -181,7 +181,7 @@ static int suspend_prepare(void)
pm_prepare_console(); pm_prepare_console();
if (freeze_processes()) { if (suspend_freeze_processes()) {
error = -EAGAIN; error = -EAGAIN;
goto Thaw; goto Thaw;
} }
...@@ -199,7 +199,7 @@ static int suspend_prepare(void) ...@@ -199,7 +199,7 @@ static int suspend_prepare(void)
return 0; return 0;
Thaw: Thaw:
thaw_processes(); suspend_thaw_processes();
pm_restore_console(); pm_restore_console();
Finish: Finish:
pm_notifier_call_chain(PM_POST_SUSPEND); pm_notifier_call_chain(PM_POST_SUSPEND);
...@@ -308,7 +308,7 @@ int suspend_devices_and_enter(suspend_state_t state) ...@@ -308,7 +308,7 @@ int suspend_devices_and_enter(suspend_state_t state)
*/ */
static void suspend_finish(void) static void suspend_finish(void)
{ {
thaw_processes(); suspend_thaw_processes();
pm_restore_console(); pm_restore_console();
pm_notifier_call_chain(PM_POST_SUSPEND); pm_notifier_call_chain(PM_POST_SUSPEND);
} }
......
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/suspend_ioctls.h> #include <linux/suspend_ioctls.h>
#include <linux/utsname.h> #include <linux/utsname.h>
#include <linux/freezer.h>
struct swsusp_info { struct swsusp_info {
struct new_utsname uts; struct new_utsname uts;
...@@ -203,3 +204,24 @@ enum { ...@@ -203,3 +204,24 @@ enum {
#define TEST_MAX (__TEST_AFTER_LAST - 1) #define TEST_MAX (__TEST_AFTER_LAST - 1)
extern int pm_test_level; 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment