OSDN Git Service

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>
Mon, 4 Jan 2021 15:47:05 +0000 (16:47 +0100)
commit77adb8bdf4227257e26b7ff67272678e66a0b250
tree69713ca410761f2bdb0868bcdabdf29dbb62e99d
parent8280de6ab07b4c63eb607662754f151e539031a1
usb: dwc3: gadget: Allow runtime suspend if UDC unbinded

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