linux-stable/drivers/usb
Clément Lassieur c7188d1998 usb: dwc2: Don't reset the core after setting turnaround time
[ Upstream commit aafe93516b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-07-14 16:56:43 +02:00
..
atm
c67x00
cdns3 usb: cdns3: Fix runtime PM imbalance on error 2021-06-16 12:01:35 +02:00
chipidea usb: chipidea: imx: Fix Battery Charger 1.2 CDP detection 2021-06-23 14:42:50 +02:00
class USB: cdc-acm: blacklist Heimann USB Appset device 2021-07-14 16:55:37 +02:00
common
core usb: core: hub: Disable autosuspend for Cypress CY7C65632 2021-06-23 14:42:50 +02:00
dwc2 usb: dwc2: Don't reset the core after setting turnaround time 2021-07-14 16:56:43 +02:00
dwc3 usb: dwc3: Fix debugfs creation flow 2021-07-14 16:55:38 +02:00
early usb: early: ehci-dbgp: convert to readl_poll_timeout_atomic() 2020-09-25 16:29:09 +02:00
gadget usb: gadget: f_fs: Fix setting of device and driver data cross-references 2021-07-14 16:56:43 +02:00
host xhci: solve a double free problem while doing s4 2021-07-14 16:55:38 +02:00
image
isp1760 usb: isp1760-hcd: convert to readl_poll_timeout_atomic() 2020-09-25 16:30:05 +02:00
misc USB: trancevibrator: fix control-request direction 2021-06-03 09:00:34 +02:00
mon
mtu3 usb: mtu3: fix memory corruption in mtu3_debugfs_regset() 2020-12-26 16:02:38 +01:00
musb usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling 2021-06-16 12:01:41 +02:00
phy usb: phy: phy-ab8500-usb: fix spello of "function" 2020-10-02 09:57:41 +03:00
renesas_usbhs usb: renesas_usbhs: Clear PIPECFG for re-enabling pipe with other EPNUM 2021-03-17 17:06:29 +01:00
roles usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode() 2021-05-14 09:49:55 +02:00
serial USB: serial: cp210x: fix alternate function for CP2102N QFN20 2021-06-16 12:01:42 +02:00
storage usb-storage: Add quirk to defeat Kindle's automatic unload 2021-03-25 09:04:14 +01:00
typec usb: typec: Add the missed altmode_id_remove() in typec_register_altmode() 2021-07-14 16:55:38 +02:00
usbip usbip: vudc: fix missing unlock on error in usbip_sockfd_store() 2021-05-14 09:50:19 +02:00
Kconfig
Makefile
usb-skeleton.c