Re: [PATCH] properly stop devices before poweroff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 On Sun, Jun 26, Linux Kernel Mailing List wrote:

> tree e2de713c76ddb42b091305b88aa7ca4938081789
> parent 5ce47e59c9688d8480ae41100117d8188c191401
> author Pavel Machek <[email protected]> Sun, 26 Jun 2005 04:55:11 -0700
> committer Linus Torvalds <[email protected]> Sun, 26 Jun 2005 06:24:33 -0700
> 
> [PATCH] properly stop devices before poweroff
> 
> Without this patch, Linux provokes emergency disk shutdowns and
> similar nastiness. It was in SuSE kernels for some time, IIRC.
> 
> Signed-off-by: Pavel Machek <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> Signed-off-by: Linus Torvalds <[email protected]>
> 
>  include/linux/pm.h |   33 +++++++++++++++++++++------------
>  kernel/sys.c       |    3 +++
>  2 files changed, 24 insertions(+), 12 deletions(-)

> +++ b/kernel/sys.c
> @@ -405,6 +405,7 @@ asmlinkage long sys_reboot(int magic1, i
>  	case LINUX_REBOOT_CMD_HALT:
>  		notifier_call_chain(&reboot_notifier_list, SYS_HALT, NULL);
>  		system_state = SYSTEM_HALT;
> +		device_suspend(PMSG_SUSPEND);
>  		device_shutdown();
>  		printk(KERN_EMERG "System halted.\n");
>  		machine_halt();
> @@ -415,6 +416,7 @@ asmlinkage long sys_reboot(int magic1, i
>  	case LINUX_REBOOT_CMD_POWER_OFF:
>  		notifier_call_chain(&reboot_notifier_list, SYS_POWER_OFF, NULL);
>  		system_state = SYSTEM_POWER_OFF;
> +		device_suspend(PMSG_SUSPEND);
>  		device_shutdown();
>  		printk(KERN_EMERG "Power down.\n");
>  		machine_power_off();

This change for 'case LINUX_REBOOT_CMD_POWER_OFF' causes an endless hang
after 'halt -p' on my Macs with USB keyboard.
It went into rc1, but the hang in an usb device (1-1.3) shows up only
with rc3. Why is device_suspend() called anyway if the
system will go down anyway in a few milliseconds?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux