From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Marcus Better <marcus@better.se>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-pm@lists.linux-foundation.org,
Andrew Morton <akpm@linux-foundation.org>,
Pavel Machek <pavel@ucw.cz>
Subject: Re: 2.6.21 suspend-to-disk regression
Date: Thu, 3 May 2007 10:06:26 +0200 [thread overview]
Message-ID: <200705031006.27068.rjw@sisk.pl> (raw)
In-Reply-To: <200705021341.32454.marcus@better.se>
On Wednesday, 2 May 2007 13:41, Marcus Better wrote:
> Rafael J. Wysocki wrote:
> > OK, so please run with it applied for a while to make sure it helps.
>
> I have tested some more, and it seems to work. There was only the one reboot
> during writing that happened on my first attempt, but it hasn't happened
> since then.
Could you please test the appended patch instead of the previous one?
Rafael
---
kernel/power/disk.c | 4 +++-
kernel/power/user.c | 15 +++------------
2 files changed, 6 insertions(+), 13 deletions(-)
Index: linux-2.6.21/kernel/power/disk.c
===================================================================
--- linux-2.6.21.orig/kernel/power/disk.c 2007-05-02 22:09:55.000000000 +0200
+++ linux-2.6.21/kernel/power/disk.c 2007-05-02 22:18:06.000000000 +0200
@@ -215,7 +215,9 @@ int hibernate(void)
Enable_cpus:
enable_nonboot_cpus();
Resume_devices:
- platform_finish();
+ if (error)
+ platform_finish();
+
device_resume();
resume_console();
Thaw:
Index: linux-2.6.21/kernel/power/user.c
===================================================================
--- linux-2.6.21.orig/kernel/power/user.c 2007-05-02 22:09:55.000000000 +0200
+++ linux-2.6.21/kernel/power/user.c 2007-05-02 22:18:06.000000000 +0200
@@ -169,7 +169,7 @@ static inline int snapshot_suspend(int p
}
enable_nonboot_cpus();
Resume_devices:
- if (platform_suspend)
+ if (platform_suspend && (!in_suspend || error))
platform_finish();
device_resume();
@@ -179,17 +179,12 @@ static inline int snapshot_suspend(int p
return error;
}
-static inline int snapshot_restore(int platform_suspend)
+static inline int snapshot_restore(void)
{
int error;
mutex_lock(&pm_mutex);
pm_prepare_console();
- if (platform_suspend) {
- error = platform_prepare();
- if (error)
- goto Finish;
- }
suspend_console();
error = device_suspend(PMSG_PRETHAW);
if (error)
@@ -201,12 +196,8 @@ static inline int snapshot_restore(int p
enable_nonboot_cpus();
Resume_devices:
- if (platform_suspend)
- platform_finish();
-
device_resume();
resume_console();
- Finish:
pm_restore_console();
mutex_unlock(&pm_mutex);
return error;
@@ -272,7 +263,7 @@ static int snapshot_ioctl(struct inode *
error = -EPERM;
break;
}
- error = snapshot_restore(data->platform_suspend);
+ error = snapshot_restore();
break;
case SNAPSHOT_FREE:
next prev parent reply other threads:[~2007-05-03 8:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-29 14:22 2.6.21 suspend-to-disk regression Marcus Better
2007-04-29 16:32 ` Rafael J. Wysocki
2007-04-30 6:58 ` Marcus Better
2007-04-30 8:11 ` Marcus Better
2007-04-30 12:34 ` Marcus Better
2007-04-30 14:21 ` Rafael J. Wysocki
2007-04-30 14:21 ` Johannes Berg
2007-05-02 9:20 ` Pavel Machek
2007-05-02 11:41 ` Marcus Better
2007-05-03 8:06 ` Rafael J. Wysocki [this message]
2007-05-03 11:41 ` Marcus Better
2007-05-03 13:06 ` Rafael J. Wysocki
2007-05-03 18:08 ` Marcus Better
2007-05-03 18:34 ` Rafael J. Wysocki
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=200705031006.27068.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=johannes@sipsolutions.net \
--cc=linux-pm@lists.linux-foundation.org \
--cc=marcus@better.se \
--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