* [PATCH v2] PM: make freezer optional for suspend
@ 2007-12-04 14:02 Johannes Berg
2007-12-08 0:27 ` Rafael J. Wysocki
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2007-12-04 14:02 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-pm
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>
---
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 ++++++
3 files changed, 21 insertions(+)
--- everything.orig/kernel/power/main.c 2007-12-04 14:59:03.126410862 +0100
+++ everything/kernel/power/main.c 2007-12-04 15:00:19.226410156 +0100
@@ -79,10 +79,12 @@ static int suspend_prepare(void)
pm_prepare_console();
+#ifdef CONFIG_SUSPEND_FREEZER
if (freeze_processes()) {
error = -EAGAIN;
goto Thaw;
}
+#endif
free_pages = global_page_state(NR_FREE_PAGES);
if (free_pages < FREE_PAGE_NUMBER) {
@@ -96,8 +98,10 @@ static int suspend_prepare(void)
if (!error)
return 0;
+#ifdef CONFIG_SUSPEND_FREEZER
Thaw:
thaw_processes();
+#endif
pm_restore_console();
Finish:
pm_notifier_call_chain(PM_POST_SUSPEND);
@@ -191,7 +195,9 @@ int suspend_devices_and_enter(suspend_st
*/
static void suspend_finish(void)
{
+#ifdef CONFIG_SUSPEND_FREEZER
thaw_processes();
+#endif
pm_restore_console();
pm_notifier_call_chain(PM_POST_SUSPEND);
}
--- everything.orig/kernel/power/Kconfig 2007-12-04 14:59:03.176410807 +0100
+++ everything/kernel/power/Kconfig 2007-12-04 15:00:19.226410156 +0100
@@ -97,6 +97,17 @@ config SUSPEND
powered and thus its contents are preserved, such as the
suspend-to-RAM state (i.e. 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_UP_POSSIBLE
bool
depends on X86 || PPC64_SWSUSP || PPC32
--- everything.orig/arch/powerpc/Kconfig 2007-12-04 14:59:03.266409342 +0100
+++ everything/arch/powerpc/Kconfig 2007-12-04 15:00:19.226410156 +0100
@@ -365,6 +365,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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] PM: make freezer optional for suspend
2007-12-08 0:27 ` Rafael J. Wysocki
@ 2007-12-08 0:12 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2007-12-08 0:12 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 733 bytes --]
On Sat, 2007-12-08 at 01:27 +0100, Rafael J. Wysocki wrote:
> On Tuesday, 4 of December 2007, Johannes Berg wrote:
> > This patch makes the freezer optional for suspend to allow the
> > system to work (or not work) like the original PMU suspend.
>
> Generally looks good to me, but I'd probably define suspend_freeze_processes()
> and suspend_thaw_processes() to be identical to freeze_processes() and
> thaw_processes(), respectively, if CONFIG_SUSPEND_FREEZER is set, or to be no
> ops otherwise (power.h seems to be the right place).
Didn't think it was worth it, but I can do that. Will repost when I get
around to it.
> The other two patches are fine, I'll push them to Len in a while.
Thanks!
johannes
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] PM: make freezer optional for suspend
2007-12-04 14:02 [PATCH v2] PM: make freezer optional for suspend Johannes Berg
@ 2007-12-08 0:27 ` Rafael J. Wysocki
2007-12-08 0:12 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2007-12-08 0:27 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-pm
On Tuesday, 4 of December 2007, Johannes Berg wrote:
> This patch makes the freezer optional for suspend to allow the
> system to work (or not work) like the original PMU suspend.
Generally looks good to me, but I'd probably define suspend_freeze_processes()
and suspend_thaw_processes() to be identical to freeze_processes() and
thaw_processes(), respectively, if CONFIG_SUSPEND_FREEZER is set, or to be no
ops otherwise (power.h seems to be the right place).
The other two patches are fine, I'll push them to Len in a while.
Thanks,
Rafael
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> 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 ++++++
> 3 files changed, 21 insertions(+)
>
> --- everything.orig/kernel/power/main.c 2007-12-04 14:59:03.126410862 +0100
> +++ everything/kernel/power/main.c 2007-12-04 15:00:19.226410156 +0100
> @@ -79,10 +79,12 @@ static int suspend_prepare(void)
>
> pm_prepare_console();
>
> +#ifdef CONFIG_SUSPEND_FREEZER
> if (freeze_processes()) {
> error = -EAGAIN;
> goto Thaw;
> }
> +#endif
>
> free_pages = global_page_state(NR_FREE_PAGES);
> if (free_pages < FREE_PAGE_NUMBER) {
> @@ -96,8 +98,10 @@ static int suspend_prepare(void)
> if (!error)
> return 0;
>
> +#ifdef CONFIG_SUSPEND_FREEZER
> Thaw:
> thaw_processes();
> +#endif
> pm_restore_console();
> Finish:
> pm_notifier_call_chain(PM_POST_SUSPEND);
> @@ -191,7 +195,9 @@ int suspend_devices_and_enter(suspend_st
> */
> static void suspend_finish(void)
> {
> +#ifdef CONFIG_SUSPEND_FREEZER
> thaw_processes();
> +#endif
> pm_restore_console();
> pm_notifier_call_chain(PM_POST_SUSPEND);
> }
> --- everything.orig/kernel/power/Kconfig 2007-12-04 14:59:03.176410807 +0100
> +++ everything/kernel/power/Kconfig 2007-12-04 15:00:19.226410156 +0100
> @@ -97,6 +97,17 @@ config SUSPEND
> powered and thus its contents are preserved, such as the
> suspend-to-RAM state (i.e. 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_UP_POSSIBLE
> bool
> depends on X86 || PPC64_SWSUSP || PPC32
> --- everything.orig/arch/powerpc/Kconfig 2007-12-04 14:59:03.266409342 +0100
> +++ everything/arch/powerpc/Kconfig 2007-12-04 15:00:19.226410156 +0100
> @@ -365,6 +365,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
>
>
>
>
>
--
"Premature optimization is the root of all evil." - Donald Knuth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-08 0:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-04 14:02 [PATCH v2] PM: make freezer optional for suspend Johannes Berg
2007-12-08 0:27 ` Rafael J. Wysocki
2007-12-08 0:12 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox