diff mbox series

[1/2] usb: gadget: composite: Clear "suspended" on reset/disconnect

Message ID 20190726045904.17860-2-benh@kernel.crashing.org (mailing list archive)
State Mainlined
Commit 602fda17c7356bb7ae98467d93549057481d11dd
Headers show
Series usb: gadget: Composite and Mass Storage fixes | expand

Commit Message

Benjamin Herrenschmidt July 26, 2019, 4:59 a.m. UTC
In some cases, one can get out of suspend with a reset or
a disconnect followed by a reconnect. Previously we would
leave a stale suspended flag set.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 drivers/usb/gadget/composite.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 9118b42c70b6..76883ff4f5bb 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1976,6 +1976,7 @@  void composite_disconnect(struct usb_gadget *gadget)
 	 * disconnect callbacks?
 	 */
 	spin_lock_irqsave(&cdev->lock, flags);
+	cdev->suspended = 0;
 	if (cdev->config)
 		reset_config(cdev);
 	if (cdev->driver->disconnect)