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

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
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
misc
mon
mtu3
musb usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling 2021-06-16 12:01:41 +02:00
phy
renesas_usbhs
roles
serial USB: serial: cp210x: fix alternate function for CP2102N QFN20 2021-06-16 12:01:42 +02:00
storage
typec usb: typec: Add the missed altmode_id_remove() in typec_register_altmode() 2021-07-14 16:55:38 +02:00
usbip
Kconfig
Makefile
usb-skeleton.c