diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-07-26 10:29:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-26 15:13:06 -0400 |
commit | 58b3b71dfaaecbf7cff1fe10c049d663f0313e5f (patch) | |
tree | 38f34ce39e1c93d6d54730ead4e414a5070e3b45 | |
parent | 602033ed5907a59ce86f709082a35be047743a86 (diff) |
Fix ThinkPad T42 poweroff failure introduced by by "PM: Introduce pm_power_off_prepare"
Commit bd804eba1c8597cbb7cd5a5f9fe886aae16a079a ("PM: Introduce
pm_power_off_prepare") caused problems in the poweroff path, as reported by
YOSHIFUJI Hideaki / 吉藤英明.
Generally, sysdev_shutdown() should be called after the ACPI preparation for
powering the system off. To make it happen, we can separate sysdev_shutdown()
from device_shutdown() and call it directly wherever necessary.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/base/power/shutdown.c | 2 | ||||
-rw-r--r-- | include/linux/device.h | 3 | ||||
-rw-r--r-- | kernel/power/disk.c | 1 | ||||
-rw-r--r-- | kernel/sys.c | 3 |
4 files changed, 7 insertions, 2 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c index a47ee1b70d20..56e8eaaac012 100644 --- a/drivers/base/power/shutdown.c +++ b/drivers/base/power/shutdown.c | |||
@@ -44,7 +44,5 @@ void device_shutdown(void) | |||
44 | dev->driver->shutdown(dev); | 44 | dev->driver->shutdown(dev); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | |||
48 | sysdev_shutdown(); | ||
49 | } | 47 | } |
50 | 48 | ||
diff --git a/include/linux/device.h b/include/linux/device.h index d9f0a57f5a2f..3a38d1f70cb7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -551,6 +551,9 @@ extern void put_device(struct device * dev); | |||
551 | /* drivers/base/power/shutdown.c */ | 551 | /* drivers/base/power/shutdown.c */ |
552 | extern void device_shutdown(void); | 552 | extern void device_shutdown(void); |
553 | 553 | ||
554 | /* drivers/base/sys.c */ | ||
555 | extern void sysdev_shutdown(void); | ||
556 | |||
554 | 557 | ||
555 | /* drivers/base/firmware.c */ | 558 | /* drivers/base/firmware.c */ |
556 | extern int __must_check firmware_register(struct kset *); | 559 | extern int __must_check firmware_register(struct kset *); |
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 324ac0188ce1..eb72255b5c86 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -216,6 +216,7 @@ int hibernation_platform_enter(void) | |||
216 | * sleep state after all | 216 | * sleep state after all |
217 | */ | 217 | */ |
218 | error = hibernation_ops->prepare(); | 218 | error = hibernation_ops->prepare(); |
219 | sysdev_shutdown(); | ||
219 | if (!error) | 220 | if (!error) |
220 | error = hibernation_ops->enter(); | 221 | error = hibernation_ops->enter(); |
221 | } else { | 222 | } else { |
diff --git a/kernel/sys.c b/kernel/sys.c index 08562f419768..14f8adcfffd9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -804,6 +804,7 @@ static void kernel_restart_prepare(char *cmd) | |||
804 | blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); | 804 | blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); |
805 | system_state = SYSTEM_RESTART; | 805 | system_state = SYSTEM_RESTART; |
806 | device_shutdown(); | 806 | device_shutdown(); |
807 | sysdev_shutdown(); | ||
807 | } | 808 | } |
808 | 809 | ||
809 | /** | 810 | /** |
@@ -860,6 +861,7 @@ void kernel_shutdown_prepare(enum system_states state) | |||
860 | void kernel_halt(void) | 861 | void kernel_halt(void) |
861 | { | 862 | { |
862 | kernel_shutdown_prepare(SYSTEM_HALT); | 863 | kernel_shutdown_prepare(SYSTEM_HALT); |
864 | sysdev_shutdown(); | ||
863 | printk(KERN_EMERG "System halted.\n"); | 865 | printk(KERN_EMERG "System halted.\n"); |
864 | machine_halt(); | 866 | machine_halt(); |
865 | } | 867 | } |
@@ -876,6 +878,7 @@ void kernel_power_off(void) | |||
876 | kernel_shutdown_prepare(SYSTEM_POWER_OFF); | 878 | kernel_shutdown_prepare(SYSTEM_POWER_OFF); |
877 | if (pm_power_off_prepare) | 879 | if (pm_power_off_prepare) |
878 | pm_power_off_prepare(); | 880 | pm_power_off_prepare(); |
881 | sysdev_shutdown(); | ||
879 | printk(KERN_EMERG "Power down.\n"); | 882 | printk(KERN_EMERG "Power down.\n"); |
880 | machine_power_off(); | 883 | machine_power_off(); |
881 | } | 884 | } |