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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:20:44 +0000 (10:20 +0200)
[ Upstream commit 602fda17c7356bb7ae98467d93549057481d11dd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/composite.c

index b805962f5154393b803c054c8c30074b8d0a6ca7..75c42393b64ba9d7bf016a968c16f5dda7df09a5 100644 (file)
@@ -2008,6 +2008,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)