From: Stefan Seyfried <seife@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Pavel Machek <pavel@suse.cz>, "Rafael J. Wysocki" <rjw@sisk.pl>,
Andrew Morton <akpm@osdl.org>
Subject: [PATCH] swsusp: fix platform mode
Date: Tue, 17 Oct 2006 22:19:22 +0200 [thread overview]
Message-ID: <20061017201922.GA4915@suse.de> (raw)
At some point after 2.6.13, in-kernel software suspend got "incomplete"
for the so-called "platform" mode. pm_ops->prepare() is never called.
A visible sign of this is the "moon" light on thinkpads not flashing
during suspend. Fix by readding the pm_ops->prepare call during suspend.
Signed-off-by: Stefan Seyfried <seife@suse.de>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
---
kernel/power/disk.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
--- linux/kernel/power/disk.c 2006-09-20 05:42:06.000000000 +0200
+++ linux-2.6.18.patched/kernel/power/disk.c 2006-10-17 22:03:26.000000000 +0200
@@ -27,6 +27,22 @@ char resume_file[256] = CONFIG_PM_STD_PA
dev_t swsusp_resume_device;
/**
+ * platform_prepare - prepare the machine for hibernation using the
+ * platform driver if so configured and return an error code if it fails
+ */
+
+static inline int platform_prepare(void)
+{
+ int error = 0;
+
+ if (pm_disk_mode == PM_DISK_PLATFORM) {
+ if (pm_ops && pm_ops->prepare)
+ error = pm_ops->prepare(PM_SUSPEND_DISK);
+ }
+ return error;
+}
+
+/**
* power_down - Shut machine down for hibernate.
* @mode: Suspend-to-disk mode
*
@@ -79,9 +95,15 @@ static int prepare_processes(void)
goto thaw;
}
+ error = platform_prepare();
+ if (error)
+ goto thaw;
+
/* Free memory before shutting down devices. */
if (!(error = swsusp_shrink_memory()))
return 0;
+
+ platform_finish();
thaw:
thaw_processes();
enable_nonboot_cpus();
--
Stefan Seyfried
QA / R&D Team Mobile Devices | "Any ideas, John?"
SUSE LINUX Products GmbH, Nürnberg | "Well, surrounding them's out."
reply other threads:[~2006-10-17 20:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061017201922.GA4915@suse.de \
--to=seife@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=rjw@sisk.pl \
/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