Commit 8a05aac2 authored by Stefan Seyfried's avatar Stefan Seyfried Committed by Linus Torvalds

[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: default avatarStefan Seyfried <seife@suse.de>
Acked-by: default avatar"Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 85949121
...@@ -29,6 +29,22 @@ char resume_file[256] = CONFIG_PM_STD_PARTITION; ...@@ -29,6 +29,22 @@ char resume_file[256] = CONFIG_PM_STD_PARTITION;
dev_t swsusp_resume_device; dev_t swsusp_resume_device;
sector_t swsusp_resume_block; 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. * power_down - Shut machine down for hibernate.
* @mode: Suspend-to-disk mode * @mode: Suspend-to-disk mode
...@@ -91,9 +107,15 @@ static int prepare_processes(void) ...@@ -91,9 +107,15 @@ static int prepare_processes(void)
goto thaw; goto thaw;
} }
error = platform_prepare();
if (error)
goto thaw;
/* Free memory before shutting down devices. */ /* Free memory before shutting down devices. */
if (!(error = swsusp_shrink_memory())) if (!(error = swsusp_shrink_memory()))
return 0; return 0;
platform_finish();
thaw: thaw:
thaw_processes(); thaw_processes();
enable_cpus: enable_cpus:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment