Skip to contentSkip to conversation

Remove suspend() calls from shutdown path

PATCH In review Benjamin Herrenschmidt 4 participants 7 messages Aug 4, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove suspend() calls from shutdown path

Hi Andrew !

This patch remove the calls to device_suspend() from the shutdown path that were added sometime during 2.6.13-rc*. They aren't working properly on a number of configs (I got reports from both ppc powerbook users and x86 users) causing the system to not shutdown anymore.

I think it isn't the right approach at the moment anyway. We have already a shutdown() callback for the drivers that actually care about shutdown and the suspend() code isn't yet in a good enough shape to be so much generalized. Also, the semantics of suspend and shutdown are slightly different on a number of setups and the way this was patched in provides little way for drivers to cleanly differenciate. It should have been at least a different message.

For 2.6.13, I think we should revert to 2.6.12 behaviour and have a working suspend back.

kernel/sys.c +0 -2
Index: linux-work/kernel/sys.c
===================================================================
@@ -404,7 +404,6 @@
 {
 	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,7 +414,6 @@
 {
 	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();
#1 lore raw

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

Z.

Quoted 47 lines · Benjamin Herrenschmidt

Hi Andrew !

This patch remove the calls to device_suspend() from the shutdown path that were added sometime during 2.6.13-rc*. They aren't working properly on a number of configs (I got reports from both ppc powerbook users and x86 users) causing the system to not shutdown anymore.

I think it isn't the right approach at the moment anyway. We have already a shutdown() callback for the drivers that actually care about shutdown and the suspend() code isn't yet in a good enough shape to be so much generalized. Also, the semantics of suspend and shutdown are slightly different on a number of setups and the way this was patched in provides little way for drivers to cleanly differenciate. It should have been at least a different message.

For 2.6.13, I think we should revert to 2.6.12 behaviour and have a working suspend back.

Index: linux-work/kernel/sys.c
===================================================================

kernel/sys.c +0 -3
@@ -404,7 +404,6 @@
 {
 	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,7 +414,6 @@
 {
 	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();
 
 
-

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/

#2 lore raw
Quoted 9 lines · Zilvinas Valinskas

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

This is unclear.

I would expect the behaviour you report to happen _without_ this patch, that is with current git tree, and I would expect this patch to fix it by reverting to the previous 2.6.12 behaviour...

Ben.

#3 lore raw
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 9 lines · Zilvinas Valinskas

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

Quoted 7 lines

This is unclear.

I would expect the behaviour you report to happen _without_ this patch, that is with current git tree, and I would expect this patch to fix it by reverting to the previous 2.6.12 behaviour...

Ben.

Sys-rq - T: shows device_suspend() is called, perhaps that explains. It seems that any attempt to suspend either USB hub or device connected to it results in freeze. :\ Just guessing.

Anything else should I try ?

hcd_submit_urb
wait_for_completion
default_wake_function
usb_start_wait_urb
timeout_kill
usb_internal_control_msg
usb_control_msg
hub_port_suspend
__usb_suspend_device
locktree
usb_suspend_device
__link_walk_path
device_suspend <----- still called ?
ohci_reboot
generic_ide_ioctl
activate_task
__group_send_sig_info
sys_kill
block_ioctl
block_ioctl
do_ioctl
vfs_ioctl
get_name
sys_ioctl
sys_enter_esp

#4 lore raw
In reply to Benjamin Herrenschmidt
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Zilvinas Valinskas

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

Quoted 8 lines
Quoted 2 lines

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

This is unclear.

I would expect the behaviour you report to happen _without_ this patch, that is with current git tree, and I would expect this patch to fix it by reverting to the previous 2.6.12 behaviour...

I had this problem on a dual-core Athlon-based machine, but the patch apparently fixed it.

Rafael

Signature · 3 lines
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"
#5 lore raw
Quoted 13 lines · Rafael J. Wysocki
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 9 lines · Zilvinas Valinskas

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

Quoted 9 lines
Quoted 5 lines

This is unclear.

I would expect the behaviour you report to happen _without_ this patch, that is with current git tree, and I would expect this patch to fix it by reverting to the previous 2.6.12 behaviour...

I had this problem on a dual-core Athlon-based machine, but the patch apparently fixed it.

So are all the (three?) bugs (regressions) which you were reporting now fixed?

#6 lore raw
Quoted 20 lines · you
Quoted 19 lines · Rafael J. Wysocki
Quoted 16 lines · Benjamin Herrenschmidt
Quoted 9 lines · Zilvinas Valinskas

Hello Ben, Andrew,

This patch helps me if I disconnect all USB peripherals before shutting down notebook. With connected peripherals (USB mouse, PL2303 USB<->serial converter/port) - powering off process stops right after unmounting filesystems but before hda power off ...

There is a bug report for this too:
http://bugzilla.kernel.org/show_bug.cgi?id=4992

This is unclear.

I would expect the behaviour you report to happen _without_ this patch, that is with current git tree, and I would expect this patch to fix it by reverting to the previous 2.6.12 behaviour...

Quoted 6 lines
Quoted 3 lines

I had this problem on a dual-core Athlon-based machine, but the patch apparently fixed it.

So are all the (three?) bugs (regressions) which you were reporting now fixed?

Yes. As far as 2.6.13-rc5 (with the Ben's patch) is concerned, I have no visible problems whatever on any of my boxes.

Greets,
Rafael

Signature · 3 lines
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"