* [PATCH] PM: make freezer optional for suspend
@ 2007-11-13 19:04 Johannes Berg
2007-11-14 13:21 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2007-11-13 19:04 UTC (permalink / raw)
To: Len Brown; +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.)
kernel/power/Kconfig | 10 ++++++++++
kernel/power/main.c | 6 ++++++
2 files changed, 16 insertions(+)
--- everything.orig/kernel/power/main.c 2007-11-13 20:00:16.406263508 +0100
+++ everything/kernel/power/main.c 2007-11-13 20:00:17.626268174 +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-11-13 20:00:16.476274685 +0100
+++ everything/kernel/power/Kconfig 2007-11-13 20:01:10.186257269 +0100
@@ -97,6 +97,16 @@ 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 ADB_PMU || 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-13 19:04 [PATCH] PM: make freezer optional for suspend Johannes Berg
@ 2007-11-14 13:21 ` Rafael J. Wysocki
2007-11-14 14:38 ` Johannes Berg
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2007-11-14 13:21 UTC (permalink / raw)
To: Johannes Berg; +Cc: Len Brown, linux-pm
On Tuesday, 13 of November 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.
>
> 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.)
>
> kernel/power/Kconfig | 10 ++++++++++
> kernel/power/main.c | 6 ++++++
> 2 files changed, 16 insertions(+)
>
> --- everything.orig/kernel/power/main.c 2007-11-13 20:00:16.406263508 +0100
> +++ everything/kernel/power/main.c 2007-11-13 20:00:17.626268174 +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-11-13 20:00:16.476274685 +0100
> +++ everything/kernel/power/Kconfig 2007-11-13 20:01:10.186257269 +0100
> @@ -97,6 +97,16 @@ 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 ADB_PMU || BROKEN
Hm, is ADB_PMU specific to powerpc?
> + 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
Greetings,
Rafael
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-14 13:21 ` Rafael J. Wysocki
@ 2007-11-14 14:38 ` Johannes Berg
2007-11-14 21:30 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2007-11-14 14:38 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Len Brown, linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 274 bytes --]
> > +config SUSPEND_FREEZER
> > + bool "Enable freezer for suspend to RAM/standby" if ADB_PMU || BROKEN
>
> Hm, is ADB_PMU specific to powerpc?
Yes, and it's the only code that allows you to suspend w/o the freezer
right now (via PMU specific ioctls)
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] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-14 14:38 ` Johannes Berg
@ 2007-11-14 21:30 ` Rafael J. Wysocki
2007-11-15 16:47 ` Johannes Berg
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2007-11-14 21:30 UTC (permalink / raw)
To: Johannes Berg; +Cc: Len Brown, linux-pm
On Wednesday, 14 of November 2007, Johannes Berg wrote:
>
> > > +config SUSPEND_FREEZER
> > > + bool "Enable freezer for suspend to RAM/standby" if ADB_PMU || BROKEN
> >
> > Hm, is ADB_PMU specific to powerpc?
>
> Yes, and it's the only code that allows you to suspend w/o the freezer
> right now (via PMU specific ioctls)
It's a bit confusing for someone who doesn't know what ADB_PMU is.
Perhaps it might depend on something like ARCH_CAN_DO_WITHOUT_FREEZER instead?
Rafael
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-14 21:30 ` Rafael J. Wysocki
@ 2007-11-15 16:47 ` Johannes Berg
2007-11-15 20:24 ` Rafael J. Wysocki
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2007-11-15 16:47 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Len Brown, linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 729 bytes --]
> > > > +config SUSPEND_FREEZER
> > > > + bool "Enable freezer for suspend to RAM/standby" if ADB_PMU || BROKEN
> > >
> > > Hm, is ADB_PMU specific to powerpc?
> >
> > Yes, and it's the only code that allows you to suspend w/o the freezer
> > right now (via PMU specific ioctls)
>
> It's a bit confusing for someone who doesn't know what ADB_PMU is.
>
> Perhaps it might depend on something like ARCH_CAN_DO_WITHOUT_FREEZER instead?
It can't really. Things break. Ben and Paul just don't want to hear
about it. I made it depend on BROKEN so people can take it out and see
what breaks (to possibly fix it), and depend on ADB_PMU so they can have
their favourite setting without enabling BROKEN.
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] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-15 16:47 ` Johannes Berg
@ 2007-11-15 20:24 ` Rafael J. Wysocki
2007-11-16 15:58 ` Johannes Berg
0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2007-11-15 20:24 UTC (permalink / raw)
To: Johannes Berg; +Cc: Len Brown, linux-pm
On Thursday, 15 of November 2007, Johannes Berg wrote:
>
> > > > > +config SUSPEND_FREEZER
> > > > > + bool "Enable freezer for suspend to RAM/standby" if ADB_PMU || BROKEN
> > > >
> > > > Hm, is ADB_PMU specific to powerpc?
> > >
> > > Yes, and it's the only code that allows you to suspend w/o the freezer
> > > right now (via PMU specific ioctls)
> >
> > It's a bit confusing for someone who doesn't know what ADB_PMU is.
> >
> > Perhaps it might depend on something like ARCH_CAN_DO_WITHOUT_FREEZER instead?
>
> It can't really. Things break. Ben and Paul just don't want to hear
> about it. I made it depend on BROKEN so people can take it out and see
> what breaks (to possibly fix it), and depend on ADB_PMU so they can have
> their favourite setting without enabling BROKEN.
I understand that, but it's a bit confusing to put ADB_PMU, which is specific
to powerpc, into the generic configuration file.
Greetings,
Rafael
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] PM: make freezer optional for suspend
2007-11-15 20:24 ` Rafael J. Wysocki
@ 2007-11-16 15:58 ` Johannes Berg
2007-11-18 18:21 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2007-11-16 15:58 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Len Brown, linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 695 bytes --]
> > > It's a bit confusing for someone who doesn't know what ADB_PMU is.
> > >
> > > Perhaps it might depend on something like ARCH_CAN_DO_WITHOUT_FREEZER instead?
> >
> > It can't really. Things break. Ben and Paul just don't want to hear
> > about it. I made it depend on BROKEN so people can take it out and see
> > what breaks (to possibly fix it), and depend on ADB_PMU so they can have
> > their favourite setting without enabling BROKEN.
>
> I understand that, but it's a bit confusing to put ADB_PMU, which is specific
> to powerpc, into the generic configuration file.
Alright, I'll give it some thought and repost later. Maybe
ARCH_DOESNT_WANT_FREEZER ;)
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] 10+ messages in thread
* Re: Re: [PATCH] PM: make freezer optional for suspend
2007-11-16 15:58 ` Johannes Berg
@ 2007-11-18 18:21 ` Pavel Machek
2007-11-19 14:40 ` Johannes Berg
0 siblings, 1 reply; 10+ messages in thread
From: Pavel Machek @ 2007-11-18 18:21 UTC (permalink / raw)
To: Johannes Berg; +Cc: Len Brown, linux-pm
Hi!
> > > It can't really. Things break. Ben and Paul just don't want to hear
> > > about it. I made it depend on BROKEN so people can take it out and see
> > > what breaks (to possibly fix it), and depend on ADB_PMU so they can have
> > > their favourite setting without enabling BROKEN.
> >
> > I understand that, but it's a bit confusing to put ADB_PMU, which is specific
> > to powerpc, into the generic configuration file.
>
> Alright, I'll give it some thought and repost later. Maybe
> ARCH_DOESNT_WANT_FREEZER ;)
What about just
a) reverse the logic, so that it is C_SUSPEND_NO_FREEZER
b) hardcode it in ppc-specific config?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Re: [PATCH] PM: make freezer optional for suspend
2007-11-18 18:21 ` Pavel Machek
@ 2007-11-19 14:40 ` Johannes Berg
2007-11-19 16:25 ` Pavel Machek
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2007-11-19 14:40 UTC (permalink / raw)
To: Pavel Machek; +Cc: Len Brown, linux-pm
[-- Attachment #1.1: Type: text/plain, Size: 847 bytes --]
On Sun, 2007-11-18 at 18:21 +0000, Pavel Machek wrote:
> Hi!
>
> > > > It can't really. Things break. Ben and Paul just don't want to hear
> > > > about it. I made it depend on BROKEN so people can take it out and see
> > > > what breaks (to possibly fix it), and depend on ADB_PMU so they can have
> > > > their favourite setting without enabling BROKEN.
> > >
> > > I understand that, but it's a bit confusing to put ADB_PMU, which is specific
> > > to powerpc, into the generic configuration file.
> >
> > Alright, I'll give it some thought and repost later. Maybe
> > ARCH_DOESNT_WANT_FREEZER ;)
>
> What about just
>
> a) reverse the logic, so that it is C_SUSPEND_NO_FREEZER
>
> b) hardcode it in ppc-specific config?
I also wanted people interested in debugging things w/o the freezer to
use it.
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] 10+ messages in thread
* Re: Re: [PATCH] PM: make freezer optional for suspend
2007-11-19 14:40 ` Johannes Berg
@ 2007-11-19 16:25 ` Pavel Machek
0 siblings, 0 replies; 10+ messages in thread
From: Pavel Machek @ 2007-11-19 16:25 UTC (permalink / raw)
To: Johannes Berg; +Cc: Len Brown, linux-pm
Hi!
> > > > > It can't really. Things break. Ben and Paul just don't want to hear
> > > > > about it. I made it depend on BROKEN so people can take it out and see
> > > > > what breaks (to possibly fix it), and depend on ADB_PMU so they can have
> > > > > their favourite setting without enabling BROKEN.
> > > >
> > > > I understand that, but it's a bit confusing to put ADB_PMU, which is specific
> > > > to powerpc, into the generic configuration file.
> > >
> > > Alright, I'll give it some thought and repost later. Maybe
> > > ARCH_DOESNT_WANT_FREEZER ;)
> >
> > What about just
> >
> > a) reverse the logic, so that it is C_SUSPEND_NO_FREEZER
> >
> > b) hardcode it in ppc-specific config?
>
> I also wanted people interested in debugging things w/o the freezer to
> use it.
I'd say that people interested in debugging can just edit the config
manually :-).
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-11-19 16:25 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-13 19:04 [PATCH] PM: make freezer optional for suspend Johannes Berg
2007-11-14 13:21 ` Rafael J. Wysocki
2007-11-14 14:38 ` Johannes Berg
2007-11-14 21:30 ` Rafael J. Wysocki
2007-11-15 16:47 ` Johannes Berg
2007-11-15 20:24 ` Rafael J. Wysocki
2007-11-16 15:58 ` Johannes Berg
2007-11-18 18:21 ` Pavel Machek
2007-11-19 14:40 ` Johannes Berg
2007-11-19 16:25 ` Pavel Machek
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.