WSL2-Linux-Kernel/drivers/usb/dwc2
Clément Lassieur aafe93516b usb: dwc2: Don't reset the core after setting turnaround time
Every time the hub signals a reset while we (device) are hsotg->connected,
dwc2_hsotg_core_init_disconnected() is called, which in turn calls
dwc2_hs_phy_init().

GUSBCFG.USBTrdTim is cleared upon Core Soft Reset, so if
hsotg->params.phy_utmi_width is 8-bit, the value of GUSBCFG.USBTrdTim (the
default one: 0x5, corresponding to 16-bit) is always different from
hsotg->params.phy_utmi_width, thus dwc2_core_reset() is called every
time (usbcfg != usbcfg_old), which causes 2 issues:

1) The call to dwc2_core_reset() does another reset 300us after the initial
Chirp K of the first reset (which should last at least Tuch = 1ms), and
messes up the High-speed Detection Handshake: both hub and device drive
current into the D+ and D- lines at the same time.

2) GUSBCFG.USBTrdTim is cleared by the second reset, so its value is always
the default one (0x5).

Setting GUSBCFG.USBTrdTim after the potential call to dwc2_core_reset()
fixes both issues.  It is now set even when select_phy is false because the
cost of the Core Soft Reset is removed.

Fixes: 1e868545f2 ("usb: dwc2: gadget: Move gadget phy init into core phy init")
Signed-off-by: Clément Lassieur <clement@lassieur.org>
Link: https://lore.kernel.org/r/20210603155921.940651-1-clement@lassieur.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-06-09 11:25:07 +02:00
..
Kconfig usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
core.c usb: dwc2: Don't reset the core after setting turnaround time 2021-06-09 11:25:07 +02:00
core.h usb: dwc2: Fix gadget DMA unmap direction 2021-05-10 14:51:01 +02:00
core_intr.c usb: dwc2: Get rid of useless error checks in suspend interrupt 2021-04-22 11:55:34 +02:00
debug.h
debugfs.c usb: dwc2: Add STM32 related debugfs entries 2021-03-10 09:37:15 +01:00
drd.c usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
gadget.c usb: dwc2: gadget: Repair 'dwc2_hsotg_core_init_disconnected()'s documentation 2021-05-27 09:45:27 +02:00
hcd.c usb: dwc2: Add hibernation exiting flow by system resume 2021-04-22 11:55:34 +02:00
hcd.h
hcd_ddma.c
hcd_intr.c usb: dwc2: Make "trimming xfer length" a debug message 2021-01-26 18:42:15 +01:00
hcd_queue.c usb: dwc2: hcd_queue: Fix typeo in function name 'dwc2_hs_pmap_unschedule()' 2021-05-27 09:45:27 +02:00
hw.h usb: dwc2: Update enter and exit partial power down functions 2021-04-09 15:16:38 +02:00
params.c usb: dwc2: params: Fix naming of 'dwc2_get_hwparams()' in the docs 2021-05-27 09:45:27 +02:00
pci.c usb: dwc2: pci: Fix possible copy/paste issue 2021-05-27 09:45:27 +02:00
platform.c usb: dwc2: platform: Provide function name for 'dwc2_check_core_version()' 2021-05-27 09:45:26 +02:00