Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: make the autosuspend workqueue thread freezable

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>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
7ed92f1a 8ab5e8c0

+5 -1
+5 -1
drivers/usb/core/usb.c
··· 205 205 206 206 static int ksuspend_usb_init(void) 207 207 { 208 - ksuspend_usb_wq = create_singlethread_workqueue("ksuspend_usbd"); 208 + /* This workqueue is supposed to be both freezable and 209 + * singlethreaded. Its job doesn't justify running on more 210 + * than one CPU. 211 + */ 212 + ksuspend_usb_wq = create_freezeable_workqueue("ksuspend_usbd"); 209 213 if (!ksuspend_usb_wq) 210 214 return -ENOMEM; 211 215 return 0;