[PATCH (revision)] USB: make ksuspend_usbd thread non-freezable

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
This patch (as1012b) makes the ksuspend_usbd kernel thread
non-freezable.  Since the PM core has been changed to lock all devices
during a system sleep, the thread no longer needs to be frozen.  It
won't interfere with a system sleep because before trying to resume a
root hub device, it acquires the device's lock.

Signed-off-by: Alan Stern <[email protected]>

---

This is a revision of a patch that made both ksuspend_usbd and khubd 
non-freezable.  I decided it was better for khubd to use the freezer 
after all.

Keeping khubd out of the freezer isn't actually _wrong_, but it could
lead to difficulties in the unlikely case that somebody puts their
system to sleep while plugging in a new USB device.  The device would
be enumerated okay, but the device_add() calls to register it or its
interfaces would fail.  Freezing khubd avoids this possibility.


Index: usb-2.6/drivers/usb/core/usb.c
===================================================================
--- usb-2.6.orig/drivers/usb/core/usb.c
+++ usb-2.6/drivers/usb/core/usb.c
@@ -230,7 +230,7 @@ static int ksuspend_usb_init(void)
 	 * singlethreaded.  Its job doesn't justify running on more
 	 * than one CPU.
 	 */
-	ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd");
+	ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd");
 	if (!ksuspend_usb_wq)
 		return -ENOMEM;
 	return 0;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.