From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Len Brown <lenb@kernel.org>
Cc: Pavel Machek <pavel@ucw.cz>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
linux-pm <linux-pm@lists.osdl.org>,
Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH 2/2] Suspend: Add config option to disable the freezer if architecture wants that
Date: Mon, 17 Dec 2007 00:30:29 +0100 [thread overview]
Message-ID: <200712170030.30578.rjw@sisk.pl> (raw)
In-Reply-To: <200712162346.10241.rjw@sisk.pl>
From: Johannes Berg <johannes@sipsolutions.net>
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>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
In a quick test, playing sound across suspend failed to work,
it usually works when the freezer is enabled (unless you use
gstreamer.)
arch/powerpc/Kconfig | 4 ++++
kernel/power/Kconfig | 11 +++++++++++
kernel/power/main.c | 6 +++---
kernel/power/power.h | 22 ++++++++++++++++++++++
4 files changed, 40 insertions(+), 3 deletions(-)
Index: linux-2.6/kernel/power/main.c
===================================================================
--- linux-2.6.orig/kernel/power/main.c
+++ linux-2.6/kernel/power/main.c
@@ -176,7 +176,7 @@ static int suspend_prepare(void)
pm_prepare_console();
- if (freeze_processes()) {
+ if (suspend_freeze_processes()) {
error = -EAGAIN;
goto Thaw;
}
@@ -194,7 +194,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);
@@ -300,7 +300,7 @@ int suspend_devices_and_enter(suspend_st
*/
static void suspend_finish(void)
{
- thaw_processes();
+ suspend_thaw_processes();
pm_restore_console();
pm_notifier_call_chain(PM_POST_SUSPEND);
}
Index: linux-2.6/kernel/power/Kconfig
===================================================================
--- linux-2.6.orig/kernel/power/Kconfig
+++ linux-2.6/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
Index: linux-2.6/arch/powerpc/Kconfig
===================================================================
--- linux-2.6.orig/arch/powerpc/Kconfig
+++ linux-2.6/arch/powerpc/Kconfig
@@ -384,6 +384,10 @@ config CMDLINE
most cases you will need to specify the root device here.
if !44x || BROKEN
+config ARCH_WANTS_FREEZER_CONTROL
+ def_bool y
+ depends on ADB_PMU
+
source kernel/power/Kconfig
endif
Index: linux-2.6/kernel/power/power.h
===================================================================
--- linux-2.6.orig/kernel/power/power.h
+++ linux-2.6/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;
@@ -205,3 +206,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
next prev parent reply other threads:[~2007-12-16 23:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-16 22:46 [PATCH 0/2] Suspend: More cleanups Rafael J. Wysocki
2007-12-16 23:30 ` [PATCH 1/2] Suspend: Clean up suspend_64.c Rafael J. Wysocki
2007-12-17 0:26 ` Pavel Machek
2008-01-16 4:19 ` Len Brown
2007-12-16 23:30 ` Rafael J. Wysocki [this message]
2007-12-17 0:26 ` [PATCH 2/2] Suspend: Add config option to disable the freezer if architecture wants that Pavel Machek
2008-01-16 4:19 ` Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712170030.30578.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=johannes@sipsolutions.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox