diff options
author | Stefan Seyfried <seife@suse.de> | 2006-12-06 23:34:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:27 -0500 |
commit | 8a05aac2631aa0e6494d9dc990f8c68ed8b8fde7 (patch) | |
tree | 90ae9235bcffc08fea77741596c65727e80bc023 /kernel/power/disk.c | |
parent | 859491218770315ba95ee3fa09961fc71c506cae (diff) |
[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/disk.c')
-rw-r--r-- | kernel/power/disk.c | 22 |
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; | |||
30 | sector_t swsusp_resume_block; | 30 | sector_t swsusp_resume_block; |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * platform_prepare - prepare the machine for hibernation using the | ||
34 | * platform driver if so configured and return an error code if it fails | ||
35 | */ | ||
36 | |||
37 | static inline int platform_prepare(void) | ||
38 | { | ||
39 | int error = 0; | ||
40 | |||
41 | if (pm_disk_mode == PM_DISK_PLATFORM) { | ||
42 | if (pm_ops && pm_ops->prepare) | ||
43 | error = pm_ops->prepare(PM_SUSPEND_DISK); | ||
44 | } | ||
45 | return error; | ||
46 | } | ||
47 | |||
48 | /** | ||
33 | * power_down - Shut machine down for hibernate. | 49 | * power_down - Shut machine down for hibernate. |
34 | * @mode: Suspend-to-disk mode | 50 | * @mode: Suspend-to-disk mode |
35 | * | 51 | * |
@@ -91,9 +107,15 @@ static int prepare_processes(void) | |||
91 | goto thaw; | 107 | goto thaw; |
92 | } | 108 | } |
93 | 109 | ||
110 | error = platform_prepare(); | ||
111 | if (error) | ||
112 | goto thaw; | ||
113 | |||
94 | /* Free memory before shutting down devices. */ | 114 | /* Free memory before shutting down devices. */ |
95 | if (!(error = swsusp_shrink_memory())) | 115 | if (!(error = swsusp_shrink_memory())) |
96 | return 0; | 116 | return 0; |
117 | |||
118 | platform_finish(); | ||
97 | thaw: | 119 | thaw: |
98 | thaw_processes(); | 120 | thaw_processes(); |
99 | enable_cpus: | 121 | enable_cpus: |