Commit 88d10bba authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds

[PATCH] suspend: cleanup calling of power off methods.

In the lead up to 2.6.13 I fixed a large number of reboot problems by
making the calling conventions consistent.  Despite checking and double
checking my work it appears I missed an obvious one.

The S4 suspend code for PM_DISK_PLATFORM was also calling device_shutdown
without setting system_state, and was not calling the appropriate
reboot_notifier.

This patch fixes the bug by replacing the call of device_suspend with
kernel_poweroff_prepare.

Various forms of this failure have been fixed and tracked for a while.

Thanks for tracking this down go to: Alexey Starikovskiy, Meelis Roos
<mroos@linux.ee>, Nigel Cunningham <ncunningham@cyclades.com>, Pierre
Ossman <drzeus-list@drzeus.cx>

History of this bug is at:
http://bugme.osdl.org/show_bug.cgi?id=4320Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e4c94330
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/pm.h>
#include "power.h" #include "power.h"
extern suspend_disk_method_t pm_disk_mode; extern suspend_disk_method_t pm_disk_mode;
extern struct pm_ops * pm_ops;
extern int swsusp_suspend(void); extern int swsusp_suspend(void);
extern int swsusp_write(void); extern int swsusp_write(void);
...@@ -49,13 +49,11 @@ dev_t swsusp_resume_device; ...@@ -49,13 +49,11 @@ dev_t swsusp_resume_device;
static void power_down(suspend_disk_method_t mode) static void power_down(suspend_disk_method_t mode)
{ {
unsigned long flags;
int error = 0; int error = 0;
local_irq_save(flags);
switch(mode) { switch(mode) {
case PM_DISK_PLATFORM: case PM_DISK_PLATFORM:
device_shutdown(); kernel_power_off_prepare();
error = pm_ops->enter(PM_SUSPEND_DISK); error = pm_ops->enter(PM_SUSPEND_DISK);
break; break;
case PM_DISK_SHUTDOWN: case PM_DISK_SHUTDOWN:
......
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