Skip to content

Commit ad899c3

Browse files
billauergregkh
authored andcommitted
char: xillybus: Refine workqueue handling
As the wakeup work item now runs on a separate workqueue, it needs to be flushed separately along with flushing the device's workqueue. Also, move the destroy_workqueue() call to the end of the exit method, so that deinitialization is done in the opposite order of initialization. Fixes: ccbde4b ("char: xillybus: Don't destroy workqueue from work item running on it") Cc: stable <stable@kernel.org> Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Link: https://lore.kernel.org/r/20240816070200.50695-1-eli.billauer@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9bb5e74 commit ad899c3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/char/xillybus/xillyusb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,9 +2093,11 @@ static int xillyusb_discovery(struct usb_interface *interface)
20932093
* just after responding with the IDT, there is no reason for any
20942094
* work item to be running now. To be sure that xdev->channels
20952095
* is updated on anything that might run in parallel, flush the
2096-
* workqueue, which rarely does anything.
2096+
* device's workqueue and the wakeup work item. This rarely
2097+
* does anything.
20972098
*/
20982099
flush_workqueue(xdev->workq);
2100+
flush_work(&xdev->wakeup_workitem);
20992101

21002102
xdev->num_channels = num_channels;
21012103

@@ -2274,9 +2276,9 @@ static int __init xillyusb_init(void)
22742276

22752277
static void __exit xillyusb_exit(void)
22762278
{
2277-
destroy_workqueue(wakeup_wq);
2278-
22792279
usb_deregister(&xillyusb_driver);
2280+
2281+
destroy_workqueue(wakeup_wq);
22802282
}
22812283

22822284
module_init(xillyusb_init);

0 commit comments

Comments
 (0)