summaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorStefan Seyfried <seife@suse.de>2006-12-06 20:34:21 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 08:39:27 -0800
commit8a05aac2631aa0e6494d9dc990f8c68ed8b8fde7 (patch)
tree90ae9235bcffc08fea77741596c65727e80bc023 /kernel/power
parent859491218770315ba95ee3fa09961fc71c506cae (diff)
downloadlinux-8a05aac2631aa0e6494d9dc990f8c68ed8b8fde7.tar.gz
linux-8a05aac2631aa0e6494d9dc990f8c68ed8b8fde7.tar.bz2
linux-8a05aac2631aa0e6494d9dc990f8c68ed8b8fde7.zip
[PATCH] swsusp: fix platform mode
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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/disk.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index d79feeb45459..f5079231383e 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -30,6 +30,22 @@ dev_t swsusp_resume_device;
sector_t swsusp_resume_block;
/**
+ * 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
*
@@ -91,9 +107,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_cpus: