linux/drivers/usb/dwc2
Fabrice Gasnier 99b2425d91 usb: dwc2: drd: fix soft connect when gadget is unconfigured
commit 32fde84362 upstream.

When the gadget driver hasn't been (yet) configured, and the cable is
connected to a HOST, the SFTDISCON gets cleared unconditionally, so the
HOST tries to enumerate it.
At the host side, this can result in a stuck USB port or worse. When
getting lucky, some dmesg can be observed at the host side:
 new high-speed USB device number ...
 device descriptor read/64, error -110

Fix it in drd, by checking the enabled flag before calling
dwc2_hsotg_core_connect(). It will be called later, once configured,
by the normal flow:
- udc_bind_to_driver
 - usb_gadget_connect
   - dwc2_hsotg_pullup
     - dwc2_hsotg_core_connect

Fixes: 17f934024e ("usb: dwc2: override PHY input signals with usb role switch support")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/1644999135-13478-1-git-send-email-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-02 11:42:55 +01:00
..
core_intr.c
core.c
core.h usb: dwc2: drd: fix soft connect when gadget is unconfigured 2022-03-02 11:42:55 +01:00
debug.h
debugfs.c
drd.c usb: dwc2: drd: fix soft connect when gadget is unconfigured 2022-03-02 11:42:55 +01:00
gadget.c usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend 2022-02-16 12:54:20 +01:00
hcd_ddma.c
hcd_intr.c
hcd_queue.c usb: dwc2: hcd_queue: Fix use of floating point literal 2021-12-01 09:18:58 +01:00
hcd.c usb: dwc2: check return value after calling platform_get_resource() 2021-10-09 14:40:56 +02:00
hcd.h
hw.h
Kconfig
Makefile
params.c
pci.c
platform.c usb: dwc2: fix STM ID/VBUS detection startup delay in dwc2_driver_probe 2021-12-22 09:30:56 +01:00