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: ccbde4b128ef ("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>

authored by Eli Billauer and committed by Greg Kroah-Hartman ad899c30 9bb5e74b

Changed files
+5 -3
drivers
char
xillybus
+5 -3
drivers/char/xillybus/xillyusb.c
··· 2093 2093 * just after responding with the IDT, there is no reason for any 2094 2094 * work item to be running now. To be sure that xdev->channels 2095 2095 * 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. 2097 2098 */ 2098 2099 flush_workqueue(xdev->workq); 2100 + flush_work(&xdev->wakeup_workitem); 2099 2101 2100 2102 xdev->num_channels = num_channels; 2101 2103 ··· 2276 2274 2277 2275 static void __exit xillyusb_exit(void) 2278 2276 { 2279 - destroy_workqueue(wakeup_wq); 2280 - 2281 2277 usb_deregister(&xillyusb_driver); 2278 + 2279 + destroy_workqueue(wakeup_wq); 2282 2280 } 2283 2281 2284 2282 module_init(xillyusb_init);