android_kernel_motorola_sm6375/drivers/usb
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Serge Semin b90e8d5d28 usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
commit fca3f138105727c3a22edda32d02f91ce1bf11c9 upstream

Originally the procedure of the ULPI transaction finish detection has been
developed as a simple busy-loop with just decrementing counter and no
delays. It's wrong since on different systems the loop will take a
different time to complete. So if the system bus and CPU are fast enough
to overtake the ULPI bus and the companion PHY reaction, then we'll get to
take a false timeout error. Fix this by converting the busy-loop procedure
to take the standard bus speed, address value and the registers access
mode into account for the busy-loop delay calculation.

Here is the way the fix works. It's known that the ULPI bus is clocked
with 60MHz signal. In accordance with [1] the ULPI bus protocol is created
so to spend 5 and 6 clock periods for immediate register write and read
operations respectively, and 6 and 7 clock periods - for the extended
register writes and reads. Based on that we can easily pre-calculate the
time which will be needed for the controller to perform a requested IO
operation. Note we'll still preserve the attempts counter in case if the
DWC USB3 controller has got some internals delays.

[1] UTMI+ Low Pin Interface (ULPI) Specification, Revision 1.1,
    October 20, 2004, pp. 30 - 36.

Fixes: 88bc9d194f ("usb: dwc3: add ULPI interface support")
Acked-by: Heikki Krogerus <[email protected]>
Signed-off-by: Serge Semin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: stable <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-02-17 10:35:18 +01:00
..
atm
c67x00 USB: c67x00: fix use after free in c67x00_giveback_urb 2020-07-22 09:33:09 +02:00
cdns3 usb: cdns3: gadget: suspicious implicit sign extension 2020-11-10 12:37:31 +01:00
chipidea usb: chipidea: ci_hdrc_imx: add missing put_device() call in usbmisc_get_init_data() 2021-01-12 20:16:18 +01:00
class USB: usblp: don't call usb_set_interface if there's a single alt 2021-02-10 09:25:28 +01:00
common
core USB: add RESET_RESUME quirk for Snapscan 1212 2020-12-21 13:27:05 +01:00
dwc2 usb: dwc2: Fix endpoint direction check in ep_from_windex 2021-02-10 09:25:29 +01:00
dwc3 usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one 2021-02-17 10:35:18 +01:00
early USB: early: Handle AMD's spec-compliant identifiers, too 2020-04-29 16:33:13 +02:00
gadget USB: gadget: legacy: fix an error code in eth_bind() 2021-02-10 09:25:28 +01:00
host usb: host: xhci: mvebu: make USB 3.0 PHY optional for Armada 3720 2021-02-10 09:25:33 +01:00
image
isp1760
misc USB: yurex: fix control-URB timeout handling 2021-01-12 20:16:20 +01:00
mon
mtu3 usb: mtu3: fix memory corruption in mtu3_debugfs_regset() 2020-12-30 11:50:58 +01:00
musb usb: musb: Fix runtime PM imbalance on error 2020-06-10 20:24:56 +02:00
phy usb: phy: twl6030-usb: Fix a resource leak in an error handling path in 'twl6030_usb_probe()' 2020-06-03 08:21:12 +02:00
renesas_usbhs usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop() 2021-02-10 09:25:28 +01:00
roles
serial USB: serial: option: Adding support for Cinterion MV31 2021-02-10 09:25:26 +01:00
storage usb: uas: Add PNY USB Portable SSD to unusual_uas 2021-01-12 20:16:19 +01:00
typec usb: typec: Fix copy paste error for NVIDIA alt-mode description 2021-01-19 18:26:16 +01:00
usbip usb: usbip: vhci_hcd: protect shift size 2021-01-12 20:16:19 +01:00
Kconfig
Makefile
usb-skeleton.c