mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-18 23:29:57 +02:00
char: xillybus: Refine workqueue handling
commitad899c301c
upstream. 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:ccbde4b128
("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>
This commit is contained in:
parent
a7ad105b12
commit
435fc9cae2
|
@ -2093,9 +2093,11 @@ static int xillyusb_discovery(struct usb_interface *interface)
|
||||||
* just after responding with the IDT, there is no reason for any
|
* just after responding with the IDT, there is no reason for any
|
||||||
* work item to be running now. To be sure that xdev->channels
|
* work item to be running now. To be sure that xdev->channels
|
||||||
* is updated on anything that might run in parallel, flush the
|
* is updated on anything that might run in parallel, flush the
|
||||||
* workqueue, which rarely does anything.
|
* device's workqueue and the wakeup work item. This rarely
|
||||||
|
* does anything.
|
||||||
*/
|
*/
|
||||||
flush_workqueue(xdev->workq);
|
flush_workqueue(xdev->workq);
|
||||||
|
flush_work(&xdev->wakeup_workitem);
|
||||||
|
|
||||||
xdev->num_channels = num_channels;
|
xdev->num_channels = num_channels;
|
||||||
|
|
||||||
|
@ -2274,9 +2276,9 @@ static int __init xillyusb_init(void)
|
||||||
|
|
||||||
static void __exit xillyusb_exit(void)
|
static void __exit xillyusb_exit(void)
|
||||||
{
|
{
|
||||||
destroy_workqueue(wakeup_wq);
|
|
||||||
|
|
||||||
usb_deregister(&xillyusb_driver);
|
usb_deregister(&xillyusb_driver);
|
||||||
|
|
||||||
|
destroy_workqueue(wakeup_wq);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(xillyusb_init);
|
module_init(xillyusb_init);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user