Skip to content

Commit

Permalink
USB: make the autosuspend workqueue thread freezable
Browse files Browse the repository at this point in the history
This patch (as881b) makes the ksuspend_usb_wq workqueue freezable.  We
don't want a rogue workqueue thread running around, unexpectedly
suspending or resuming USB devices in the middle of a system sleep
transition.

This fixes Bugzilla #8498.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed May 23, 2007
1 parent 8ab5e8c commit 7ed92f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ struct device_type usb_device_type = {

static int ksuspend_usb_init(void)
{
ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd");
/* This workqueue is supposed to be both freezable and
* singlethreaded. Its job doesn't justify running on more
* than one CPU.
*/
ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd");
if (!ksuspend_usb_wq)
return -ENOMEM;
return 0;
Expand Down

0 comments on commit 7ed92f1

Please sign in to comment.