Bugzilla – Attachment 53919 Details for
Bug 118997
Machine does not switch off after shutdown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Reboot/Shutdown fix posted lately on acpi-devel by Eric W. Biederman (20.09.05)
reboot_shutdown_fix.diff (text/plain), 3.76 KB, created by
Thomas Renninger
on 2005-10-13 06:52:53 UTC
(
hide
)
Description:
Reboot/Shutdown fix posted lately on acpi-devel by Eric W. Biederman (20.09.05)
Filename:
MIME Type:
Creator:
Thomas Renninger
Created:
2005-10-13 06:52:53 UTC
Size:
3.76 KB
patch
obsolete
>--- linux-2.6.13/include/linux/reboot.h 2005-08-29 01:41:01.000000000 +0200 >+++ linux-2.6.13_i386_reboot_fix/include/linux/reboot.h 2005-10-10 13:20:15.000000000 +0200 >@@ -59,6 +59,10 @@ > * Architecture independent implemenations of sys_reboot commands. > */ > >+extern void kernel_restart_prepare(char *cmd); >+extern void kernel_halt_prepare(void); >+extern void kernel_power_off_prepare(void); >+ > extern void kernel_restart(char *cmd); > extern void kernel_halt(void); > extern void kernel_power_off(void); >--- linux-2.6.13/kernel/sys.c 2005-08-29 01:41:01.000000000 +0200 >+++ linux-2.6.13_i386_reboot_fix/kernel/sys.c 2005-10-10 13:20:11.000000000 +0200 >@@ -361,17 +361,36 @@ > return retval; > } > >+/** >+ * emergency_restart - reboot the system >+ * >+ * Without shutting down any hardware or taking any locks >+ * reboot the system. This is called when we know we are in >+ * trouble so this is our best effort to reboot. This is >+ * safe to call in interrupt context. >+ */ >+ > void emergency_restart(void) > { > machine_emergency_restart(); > } > EXPORT_SYMBOL_GPL(emergency_restart); > >-void kernel_restart(char *cmd) >+/** >+ * kernel_restart - reboot the system >+ * >+ * Shutdown everything and perform a clean reboot. >+ * This is not safe to call in interrupt context. >+ */ >+void kernel_restart_prepare(char *cmd) > { > notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); > system_state = SYSTEM_RESTART; > device_shutdown(); >+} >+void kernel_restart(char *cmd) >+{ >+ kernel_restart_prepare(cmd); > if (!cmd) { > printk(KERN_EMERG "Restarting system.\n"); > } else { >@@ -382,6 +401,12 @@ > } > EXPORT_SYMBOL_GPL(kernel_restart); > >+/** >+ * kernel_kexec - reboot the system >+ * >+ * Move into place and start executing a preloaded standalone >+ * executable. If nothing was preloaded return an error. >+ */ > void kernel_kexec(void) > { > #ifdef CONFIG_KEXEC >@@ -390,9 +415,7 @@ > if (!image) { > return; > } >- notifier_call_chain(&reboot_notifier_list, SYS_RESTART, NULL); >- system_state = SYSTEM_RESTART; >- device_shutdown(); >+ kernel_restart_prepare(NULL); > printk(KERN_EMERG "Starting new kernel\n"); > machine_shutdown(); > machine_kexec(image); >@@ -400,21 +423,39 @@ > } > EXPORT_SYMBOL_GPL(kernel_kexec); > >-void kernel_halt(void) >+/** >+ * kernel_halt - halt the system >+ * >+ * Shutdown everything and perform a clean system halt. >+ */ >+void kernel_halt_prepare(void) > { > notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL); > system_state = SYSTEM_HALT; > device_shutdown(); >+} >+void kernel_halt(void) >+{ >+ kernel_halt_prepare(); > printk(KERN_EMERG "System halted.\n"); > machine_halt(); > } > EXPORT_SYMBOL_GPL(kernel_halt); > >-void kernel_power_off(void) >+/** >+ * kernel_power_off - power_off the system >+ * >+ * Shutdown everything and perform a clean system power_off. >+ */ >+void kernel_power_off_prepare(void) > { > notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL); > system_state = SYSTEM_POWER_OFF; > device_shutdown(); >+} >+void kernel_power_off(void) >+{ >+ kernel_power_off_prepare(); > printk(KERN_EMERG "Power down.\n"); > machine_power_off(); > } >--- linux-2.6.13/kernel/power/disk.c 2005-08-29 01:41:01.000000000 +0200 >+++ linux-2.6.13_i386_reboot_fix/kernel/power/disk.c 2005-10-10 13:22:43.000000000 +0200 >@@ -17,12 +17,12 @@ > #include <linux/delay.h> > #include <linux/fs.h> > #include <linux/mount.h> >+#include <linux/pm.h> > > #include "power.h" > > > extern suspend_disk_method_t pm_disk_mode; >-extern struct pm_ops * pm_ops; > > extern int swsusp_suspend(void); > extern int swsusp_write(void); >@@ -49,13 +49,11 @@ > > static void power_down(suspend_disk_method_t mode) > { >- unsigned long flags; > int error = 0; > >- local_irq_save(flags); > switch(mode) { > case PM_DISK_PLATFORM: >- device_shutdown(); >+ kernel_power_off_prepare(); > error = pm_ops->enter(PM_SUSPEND_DISK); > break; > case PM_DISK_SHUTDOWN:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 118997
:
50929
|
50930
| 53919 |
55992
|
61817