usb: dwc3: gadget: Allow runtime suspend if UDC unbinded
authorWesley Cheng <wcheng@codeaurora.org>
Thu, 12 Aug 2021 17:16:47 +0000 (20:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Aug 2021 11:08:03 +0000 (13:08 +0200)
commit25a0625fa96fe76aadaddfc85f9ddc1e4396ad1f
tree97a40e06751290787f735183331c48abb6ee33b0
parent5f081a928d5533dfaf858409ee1dfff151efb5cd
usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

[ Upstream commit 77adb8bdf4227257e26b7ff67272678e66a0b250 ]

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