usb: gadget: composite: Clear "suspended" on reset/disconnect
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 26 Jul 2019 04:59:03 +0000 (14:59 +1000)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 12 Aug 2019 05:55:24 +0000 (08:55 +0300)
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>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/composite.c

index 9118b42c70b6312659eafd76f72b97434147ac2c..76883ff4f5bb6f7c4a157716c76354a01f20afc0 100644 (file)
@@ -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)