LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [RFT][PATCH] swsusp: Change code ordering related to ACPI
@ 2007-05-04 9:43 Rafael J. Wysocki
2007-05-04 18:36 ` [linux-pm] " Alexey Starikovskiy
2007-05-04 23:11 ` Ray Lee
0 siblings, 2 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2007-05-04 9:43 UTC (permalink / raw)
To: LKML; +Cc: Andrew Morton, Marcus Better, Pavel Machek, Tobias Diedrich, pm list
Hi,
The change of the hibernation/suspend code ordering made before 2.6.21 has
caused some systems to have problems related to ACPI. In particular, the
'platform' hibernation mode doesn't work any more on some systems.
It has been confirmed that the appended patch fixes the problem, but it's not
certain if this changes don't break some other systems. For this reason, all
users of hibernation (swsusp, uswsusp) are gently requested to verify if this
patch doesn't break their systems.
Greetings,
Rafael
---
From: Rafael J. Wysocki <rjw@sisk.pl>
The current code ordering in the hibernation code paths causes some systems to
have problems. It has been confirmed by testers that these problems do not
appear if the acpi_pm_finish() function (called via platform_finish()) is
executed after device_suspend().
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
kernel/power/disk.c | 4 ++--
kernel/power/user.c | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
Index: linux-2.6.21/kernel/power/disk.c
===================================================================
--- linux-2.6.21.orig/kernel/power/disk.c 2007-05-04 10:31:51.000000000 +0200
+++ linux-2.6.21/kernel/power/disk.c 2007-05-04 10:32:12.000000000 +0200
@@ -195,9 +195,9 @@ int hibernate(void)
if (in_suspend) {
enable_nonboot_cpus();
- platform_finish();
device_resume();
resume_console();
+ platform_finish();
pr_debug("PM: writing image.\n");
error = swsusp_write();
if (!error)
@@ -214,9 +214,9 @@ int hibernate(void)
Enable_cpus:
enable_nonboot_cpus();
Resume_devices:
- platform_finish();
device_resume();
resume_console();
+ platform_finish();
Thaw:
mutex_unlock(&pm_mutex);
unprepare_processes();
Index: linux-2.6.21/kernel/power/user.c
===================================================================
--- linux-2.6.21.orig/kernel/power/user.c 2007-05-04 10:31:51.000000000 +0200
+++ linux-2.6.21/kernel/power/user.c 2007-05-04 10:32:12.000000000 +0200
@@ -169,11 +169,11 @@ static inline int snapshot_suspend(int p
}
enable_nonboot_cpus();
Resume_devices:
+ device_resume();
+ resume_console();
if (platform_suspend)
platform_finish();
- device_resume();
- resume_console();
Finish:
mutex_unlock(&pm_mutex);
return error;
@@ -201,11 +201,11 @@ static inline int snapshot_restore(int p
enable_nonboot_cpus();
Resume_devices:
+ device_resume();
+ resume_console();
if (platform_suspend)
platform_finish();
- device_resume();
- resume_console();
Finish:
pm_restore_console();
mutex_unlock(&pm_mutex);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-pm] [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-04 9:43 [RFT][PATCH] swsusp: Change code ordering related to ACPI Rafael J. Wysocki
@ 2007-05-04 18:36 ` Alexey Starikovskiy
2007-05-04 18:37 ` Alexey Starikovskiy
2007-05-04 23:11 ` Ray Lee
1 sibling, 1 reply; 7+ messages in thread
From: Alexey Starikovskiy @ 2007-05-04 18:36 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Andrew Morton, Tobias Diedrich, pm list, Pavel Machek,
Marcus Better
Doing _WAK (from pm_finish) before device_resume will brake almost all
ACPI devices.
Regards,
Alex.
On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> Hi,
>
> The change of the hibernation/suspend code ordering made before 2.6.21 has
> caused some systems to have problems related to ACPI. In particular, the
> 'platform' hibernation mode doesn't work any more on some systems.
>
> It has been confirmed that the appended patch fixes the problem, but it's not
> certain if this changes don't break some other systems. For this reason, all
> users of hibernation (swsusp, uswsusp) are gently requested to verify if this
> patch doesn't break their systems.
>
> Greetings,
> Rafael
>
> ---
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> The current code ordering in the hibernation code paths causes some systems to
> have problems. It has been confirmed by testers that these problems do not
> appear if the acpi_pm_finish() function (called via platform_finish()) is
> executed after device_suspend().
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> kernel/power/disk.c | 4 ++--
> kernel/power/user.c | 8 ++++----
> 2 files changed, 6 insertions(+), 6 deletions(-)
>
> Index: linux-2.6.21/kernel/power/disk.c
> ===================================================================
> --- linux-2.6.21.orig/kernel/power/disk.c 2007-05-04 10:31:51.000000000 +0200
> +++ linux-2.6.21/kernel/power/disk.c 2007-05-04 10:32:12.000000000 +0200
> @@ -195,9 +195,9 @@ int hibernate(void)
>
> if (in_suspend) {
> enable_nonboot_cpus();
> - platform_finish();
> device_resume();
> resume_console();
> + platform_finish();
> pr_debug("PM: writing image.\n");
> error = swsusp_write();
> if (!error)
> @@ -214,9 +214,9 @@ int hibernate(void)
> Enable_cpus:
> enable_nonboot_cpus();
> Resume_devices:
> - platform_finish();
> device_resume();
> resume_console();
> + platform_finish();
> Thaw:
> mutex_unlock(&pm_mutex);
> unprepare_processes();
> Index: linux-2.6.21/kernel/power/user.c
> ===================================================================
> --- linux-2.6.21.orig/kernel/power/user.c 2007-05-04 10:31:51.000000000 +0200
> +++ linux-2.6.21/kernel/power/user.c 2007-05-04 10:32:12.000000000 +0200
> @@ -169,11 +169,11 @@ static inline int snapshot_suspend(int p
> }
> enable_nonboot_cpus();
> Resume_devices:
> + device_resume();
> + resume_console();
> if (platform_suspend)
> platform_finish();
>
> - device_resume();
> - resume_console();
> Finish:
> mutex_unlock(&pm_mutex);
> return error;
> @@ -201,11 +201,11 @@ static inline int snapshot_restore(int p
>
> enable_nonboot_cpus();
> Resume_devices:
> + device_resume();
> + resume_console();
> if (platform_suspend)
> platform_finish();
>
> - device_resume();
> - resume_console();
> Finish:
> pm_restore_console();
> mutex_unlock(&pm_mutex);
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-pm] [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-04 18:36 ` [linux-pm] " Alexey Starikovskiy
@ 2007-05-04 18:37 ` Alexey Starikovskiy
2007-05-04 19:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 7+ messages in thread
From: Alexey Starikovskiy @ 2007-05-04 18:37 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Andrew Morton, Tobias Diedrich, pm list, Pavel Machek,
Marcus Better
Sorry, I meant executing _WAK _after_ resume of devices...
Alex.
On 5/4/07, Alexey Starikovskiy <aystarik@gmail.com> wrote:
> Doing _WAK (from pm_finish) before device_resume will brake almost all
> ACPI devices.
>
> Regards,
> Alex.
>
> On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > Hi,
> >
> > The change of the hibernation/suspend code ordering made before 2.6.21 has
> > caused some systems to have problems related to ACPI. In particular, the
> > 'platform' hibernation mode doesn't work any more on some systems.
> >
> > It has been confirmed that the appended patch fixes the problem, but it's not
> > certain if this changes don't break some other systems. For this reason, all
> > users of hibernation (swsusp, uswsusp) are gently requested to verify if this
> > patch doesn't break their systems.
> >
> > Greetings,
> > Rafael
> >
> > ---
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > The current code ordering in the hibernation code paths causes some systems to
> > have problems. It has been confirmed by testers that these problems do not
> > appear if the acpi_pm_finish() function (called via platform_finish()) is
> > executed after device_suspend().
> >
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > ---
> > kernel/power/disk.c | 4 ++--
> > kernel/power/user.c | 8 ++++----
> > 2 files changed, 6 insertions(+), 6 deletions(-)
> >
> > Index: linux-2.6.21/kernel/power/disk.c
> > ===================================================================
> > --- linux-2.6.21.orig/kernel/power/disk.c 2007-05-04 10:31:51.000000000 +0200
> > +++ linux-2.6.21/kernel/power/disk.c 2007-05-04 10:32:12.000000000 +0200
> > @@ -195,9 +195,9 @@ int hibernate(void)
> >
> > if (in_suspend) {
> > enable_nonboot_cpus();
> > - platform_finish();
> > device_resume();
> > resume_console();
> > + platform_finish();
> > pr_debug("PM: writing image.\n");
> > error = swsusp_write();
> > if (!error)
> > @@ -214,9 +214,9 @@ int hibernate(void)
> > Enable_cpus:
> > enable_nonboot_cpus();
> > Resume_devices:
> > - platform_finish();
> > device_resume();
> > resume_console();
> > + platform_finish();
> > Thaw:
> > mutex_unlock(&pm_mutex);
> > unprepare_processes();
> > Index: linux-2.6.21/kernel/power/user.c
> > ===================================================================
> > --- linux-2.6.21.orig/kernel/power/user.c 2007-05-04 10:31:51.000000000 +0200
> > +++ linux-2.6.21/kernel/power/user.c 2007-05-04 10:32:12.000000000 +0200
> > @@ -169,11 +169,11 @@ static inline int snapshot_suspend(int p
> > }
> > enable_nonboot_cpus();
> > Resume_devices:
> > + device_resume();
> > + resume_console();
> > if (platform_suspend)
> > platform_finish();
> >
> > - device_resume();
> > - resume_console();
> > Finish:
> > mutex_unlock(&pm_mutex);
> > return error;
> > @@ -201,11 +201,11 @@ static inline int snapshot_restore(int p
> >
> > enable_nonboot_cpus();
> > Resume_devices:
> > + device_resume();
> > + resume_console();
> > if (platform_suspend)
> > platform_finish();
> >
> > - device_resume();
> > - resume_console();
> > Finish:
> > pm_restore_console();
> > mutex_unlock(&pm_mutex);
> > _______________________________________________
> > linux-pm mailing list
> > linux-pm@lists.linux-foundation.org
> > https://lists.linux-foundation.org/mailman/listinfo/linux-pm
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [linux-pm] [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-04 18:37 ` Alexey Starikovskiy
@ 2007-05-04 19:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2007-05-04 19:43 UTC (permalink / raw)
To: Alexey Starikovskiy
Cc: LKML, Andrew Morton, Tobias Diedrich, pm list, Pavel Machek,
Marcus Better
On Friday, 4 May 2007 20:37, Alexey Starikovskiy wrote:
> Sorry, I meant executing _WAK _after_ resume of devices...
Somehow, that's what we've done for several months at the very least.
Moreover, my test boxes apparently don't care.
OTOH, evidently, some systems have been broken by moving the call to
acpi_pm_finish() before device_resume(). This seems to implicate that there
are two parts of code in acpi_pm_finish(), one that should be executed before
device_resume(), including the _WAK method, and the other that should be
executed after device_resume(). Now, the question is how to split it into
these parts.
Greetings,
Rafael
> On 5/4/07, Alexey Starikovskiy <aystarik@gmail.com> wrote:
> > Doing _WAK (from pm_finish) before device_resume will brake almost all
> > ACPI devices.
> >
> > Regards,
> > Alex.
> >
> > On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > Hi,
> > >
> > > The change of the hibernation/suspend code ordering made before 2.6.21 has
> > > caused some systems to have problems related to ACPI. In particular, the
> > > 'platform' hibernation mode doesn't work any more on some systems.
> > >
> > > It has been confirmed that the appended patch fixes the problem, but it's not
> > > certain if this changes don't break some other systems. For this reason, all
> > > users of hibernation (swsusp, uswsusp) are gently requested to verify if this
> > > patch doesn't break their systems.
> > >
> > > Greetings,
> > > Rafael
> > >
> > > ---
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > >
> > > The current code ordering in the hibernation code paths causes some systems to
> > > have problems. It has been confirmed by testers that these problems do not
> > > appear if the acpi_pm_finish() function (called via platform_finish()) is
> > > executed after device_suspend().
> > >
> > > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> > > ---
> > > kernel/power/disk.c | 4 ++--
> > > kernel/power/user.c | 8 ++++----
> > > 2 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > Index: linux-2.6.21/kernel/power/disk.c
> > > ===================================================================
> > > --- linux-2.6.21.orig/kernel/power/disk.c 2007-05-04 10:31:51.000000000 +0200
> > > +++ linux-2.6.21/kernel/power/disk.c 2007-05-04 10:32:12.000000000 +0200
> > > @@ -195,9 +195,9 @@ int hibernate(void)
> > >
> > > if (in_suspend) {
> > > enable_nonboot_cpus();
> > > - platform_finish();
> > > device_resume();
> > > resume_console();
> > > + platform_finish();
> > > pr_debug("PM: writing image.\n");
> > > error = swsusp_write();
> > > if (!error)
> > > @@ -214,9 +214,9 @@ int hibernate(void)
> > > Enable_cpus:
> > > enable_nonboot_cpus();
> > > Resume_devices:
> > > - platform_finish();
> > > device_resume();
> > > resume_console();
> > > + platform_finish();
> > > Thaw:
> > > mutex_unlock(&pm_mutex);
> > > unprepare_processes();
> > > Index: linux-2.6.21/kernel/power/user.c
> > > ===================================================================
> > > --- linux-2.6.21.orig/kernel/power/user.c 2007-05-04 10:31:51.000000000 +0200
> > > +++ linux-2.6.21/kernel/power/user.c 2007-05-04 10:32:12.000000000 +0200
> > > @@ -169,11 +169,11 @@ static inline int snapshot_suspend(int p
> > > }
> > > enable_nonboot_cpus();
> > > Resume_devices:
> > > + device_resume();
> > > + resume_console();
> > > if (platform_suspend)
> > > platform_finish();
> > >
> > > - device_resume();
> > > - resume_console();
> > > Finish:
> > > mutex_unlock(&pm_mutex);
> > > return error;
> > > @@ -201,11 +201,11 @@ static inline int snapshot_restore(int p
> > >
> > > enable_nonboot_cpus();
> > > Resume_devices:
> > > + device_resume();
> > > + resume_console();
> > > if (platform_suspend)
> > > platform_finish();
> > >
> > > - device_resume();
> > > - resume_console();
> > > Finish:
> > > pm_restore_console();
> > > mutex_unlock(&pm_mutex);
> > > _______________________________________________
> > > linux-pm mailing list
> > > linux-pm@lists.linux-foundation.org
> > > https://lists.linux-foundation.org/mailman/listinfo/linux-pm
> > >
> >
>
>
--
If you don't have the time to read,
you don't have the time or the tools to write.
- Stephen King
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-04 9:43 [RFT][PATCH] swsusp: Change code ordering related to ACPI Rafael J. Wysocki
2007-05-04 18:36 ` [linux-pm] " Alexey Starikovskiy
@ 2007-05-04 23:11 ` Ray Lee
2007-05-05 9:50 ` Rafael J. Wysocki
1 sibling, 1 reply; 7+ messages in thread
From: Ray Lee @ 2007-05-04 23:11 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Andrew Morton, Marcus Better, Pavel Machek,
Tobias Diedrich, pm list
On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> The change of the hibernation/suspend code ordering made before 2.6.21 has
> caused some systems to have problems related to ACPI. In particular, the
> 'platform' hibernation mode doesn't work any more on some systems.
It seems that somewhere between 2.6.21-rc4 and 2.6.21 final my laptop
stopped being able to come out of suspend to RAM. Before I start
bisecting (again, sigh), is this ringing any bells for anyone? In
particular your, patch (snipped) that deals with hibernation, would it
also affect suspend to RAM?
Ray
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-04 23:11 ` Ray Lee
@ 2007-05-05 9:50 ` Rafael J. Wysocki
2007-05-05 20:46 ` Ray Lee
0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2007-05-05 9:50 UTC (permalink / raw)
To: Ray Lee
Cc: LKML, Andrew Morton, Marcus Better, Pavel Machek,
Tobias Diedrich, pm list
On Saturday, 5 May 2007 01:11, Ray Lee wrote:
> On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > The change of the hibernation/suspend code ordering made before 2.6.21 has
> > caused some systems to have problems related to ACPI. In particular, the
> > 'platform' hibernation mode doesn't work any more on some systems.
>
> It seems that somewhere between 2.6.21-rc4 and 2.6.21 final my laptop
> stopped being able to come out of suspend to RAM. Before I start
> bisecting (again, sigh), is this ringing any bells for anyone? In
> particular your, patch (snipped) that deals with hibernation, would it
> also affect suspend to RAM?
Not this particular one, but you may try to move pm_finish() after
resume_console() in kernel/power/main.c:suspend_prepare() and see if that
helps.
If it doesn't help, then try to compile the kernel with NO_HZ and
HIGH_RES_TIMERS unset. If that doesn't help, you may try with HPET_TIMER
unset additionally.
Greetings,
Rafael
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFT][PATCH] swsusp: Change code ordering related to ACPI
2007-05-05 9:50 ` Rafael J. Wysocki
@ 2007-05-05 20:46 ` Ray Lee
0 siblings, 0 replies; 7+ messages in thread
From: Ray Lee @ 2007-05-05 20:46 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: LKML, Andrew Morton, Marcus Better, Pavel Machek,
Tobias Diedrich, pm list
On 5/5/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Saturday, 5 May 2007 01:11, Ray Lee wrote:
> > On 5/4/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > The change of the hibernation/suspend code ordering made before 2.6.21 has
> > > caused some systems to have problems related to ACPI. In particular, the
> > > 'platform' hibernation mode doesn't work any more on some systems.
> >
> > It seems that somewhere between 2.6.21-rc4 and 2.6.21 final my laptop
> > stopped being able to come out of suspend to RAM. Before I start
> > bisecting (again, sigh), is this ringing any bells for anyone? In
> > particular your, patch (snipped) that deals with hibernation, would it
> > also affect suspend to RAM?
>
> Not this particular one, but you may try to move pm_finish() after
> resume_console() in kernel/power/main.c:suspend_prepare() and see if that
> helps.
>
> If it doesn't help, then try to compile the kernel with NO_HZ and
> HIGH_RES_TIMERS unset. If that doesn't help, you may try with HPET_TIMER
> unset additionally.
Okay, my system is doing it with a known good kernel as well
(2.6.21-rc4), so this is something else. Please ignore my report for
now. In the meantime, I'll be downgrading my hal and drm to what they
were a week ago to see if that fixes the problem.
(I knew better than to change more than one thing at a time, really I
did. Sigh.)
Thanks for your help regardless,
Ray
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-05-05 20:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-04 9:43 [RFT][PATCH] swsusp: Change code ordering related to ACPI Rafael J. Wysocki
2007-05-04 18:36 ` [linux-pm] " Alexey Starikovskiy
2007-05-04 18:37 ` Alexey Starikovskiy
2007-05-04 19:43 ` Rafael J. Wysocki
2007-05-04 23:11 ` Ray Lee
2007-05-05 9:50 ` Rafael J. Wysocki
2007-05-05 20:46 ` Ray Lee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).