diff mbox series

usb: musb: Cancel delayed work on host controller rmmod

Message ID 20190915235315.54749-1-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series usb: musb: Cancel delayed work on host controller rmmod | expand

Commit Message

Tony Lindgren Sept. 15, 2019, 11:53 p.m. UTC
If we rmmod the musb host controller with gadgets configured,
musb_gadget_stop() gets called. We need to also flush the delayed
work.

Fixes: 2bff3916fda9 ("usb: musb: Fix PM for hub disconnect")
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/usb/musb/musb_gadget.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1910,6 +1910,7 @@  static int musb_gadget_stop(struct usb_gadget *g)
 
 	/* Force check of devctl register for PM runtime */
 	schedule_delayed_work(&musb->irq_work, 0);
+	flush_delayed_work(&musb->irq_work);
 
 	pm_runtime_mark_last_busy(musb->controller);
 	pm_runtime_put_autosuspend(musb->controller);