usb: xhci: add XHCI_VLI_HUB_TT_QUIRK
authorJonathan Bell <jonathan@raspberrypi.com>
Thu, 1 Dec 2022 16:59:44 +0000 (16:59 +0000)
committerPhil Elwell <8911409+pelwell@users.noreply.github.com>
Mon, 5 Dec 2022 10:29:42 +0000 (10:29 +0000)
commitc2e04f63c58c6cd886b042f1b5e121690e9148ac
tree9bfd96da89e6b218f305da688667c7f765518a6f
parent996f28d6295ad091f7edb462b52a91c8112019d1
usb: xhci: add XHCI_VLI_HUB_TT_QUIRK

The integrated USB2.0 hub in the VL805 chipset has a bug where it
incorrectly determines the remaining available frame time before the
host next sends a SOF packet with an incremented frame_number.

See the USB2.0 specification sections 11.3 and 11.14.2.3.

The hub's non-periodic TT handler can transmit the IN/OUT handshake
token too late, so a following 64-byte DATA0/1 packet causes the ACK
handshake to collide with the propagated SOF. This causes port babble.

Avoid ringing doorbells for vulnerable endpoints during uFrame 7 if the
TR is Idle to stop one source of babble. An IN transfer for a Running TR
may happen at any time, so there's not much we can do about that.

Ideally a hub firmware update to properly implement frame timeouts is
needed, and to avoid spinning for up to 125us when submitting TDs to
Idle rings.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.h