usb: dwc3: gadget: Allow runtime suspend if UDC unbinded
authorWesley Cheng <wcheng@codeaurora.org>
Tue, 29 Dec 2020 23:05:35 +0000 (15:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Mar 2021 08:04:15 +0000 (09:04 +0100)
commit395d273f29980f658ac0087019661325aa777344
tree8c559932fea607292c64fe08e2943122778594ac
parent8b8a84234c38993dd7f5e8d86344b631b501dc09
usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

commit 77adb8bdf4227257e26b7ff67272678e66a0b250 upstream.

The DWC3 runtime suspend routine checks for the USB connected parameter to
determine if the controller can enter into a low power state.  The
connected state is only set to false after receiving a disconnect event.
However, in the case of a device initiated disconnect (i.e. UDC unbind),
the controller is halted and a disconnect event is never generated.  Set
the connected flag to false if issuing a device initiated disconnect to
allow the controller to be suspended.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/1609283136-22140-2-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c