Skip to content

xHCI: Isochronous error handling fixes and improvements

Michal Pecio linux-usb lkml 2 versions – In review

Get series with b4
b4 am 20250226080202.7eb5e142@foxbook

Versions newest first · linked by author and title

  1. v3 Latest5 patches 4 repliesIn review
  2. v15 patches 6 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5usb: xhci: Don't skip on Stopped - Length Invaliddrivers/usb/host/xhci-ring.c+4 -01 reply
2/5usb: xhci: Complete 'error mid TD' transfers when handling Missed Servicedrivers/usb/host/xhci-ring.c+5 -10 replies
3/5usb: xhci: Fix isochronous Ring Underrun/Overrun event handlingdrivers/usb/host/xhci-ring.c+14 -60 replies
4/5usb: xhci: Expedite skipping missed isoch TDs on modern HCsdrivers/usb/host/xhci-ring.c+10 -40 replies
5/5usb: xhci: Skip only one TD on Ring Underrun/Overrundrivers/usb/host/xhci-ring.c+14 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/5] xHCI: Isochronous error handling fixes and improvements

These patches reduce latency of error reporting in some cases related to 'error mid TD' and Missed Service events and sometimes fix a failure to give back such TDs altogether until they are cancelled.

Also included are fixes for potential packet loss or memory corruption due to obscure races. Whether it causes problems IRL is not known and the worst case would be hard to reproduce, but exactly for this reason if the worst case actually happens, it could be hard to debug too.

The first three should be safe. The fourth should also be safe, but it relies on HC functionality Linux never relied on before, so I placed it towards the end in case it would need some tweaks. I tested it on all hardware I have and it worked just fine.

The last one is perhaps the most controversial, though it should be OK with typical "complete -> resubmit" drivers. It's the only one here which increases latency in some severe error cases. The intent is to avoid potentially giving back URBs not yet executed by hardware.

New in v3:
- dropped the cleanup patch
- added Don't skip on Stopped - Length Invalid

New in v3:
- fixed spurious empty list warning on xrun
- clear skip flag if one skipped event was the last

Michal Pecio (5):
usb: xhci: Don't skip on Stopped - Length Invalid
usb: xhci: Complete 'error mid TD' transfers when handling Missed
Service
usb: xhci: Fix isochronous Ring Underrun/Overrun event handling
usb: xhci: Expedite skipping missed isoch TDs on modern HCs
usb: xhci: Skip only one TD on Ring Underrun/Overrun

 drivers/usb/host/xhci-ring.c | 55 +++++++++++++++++++++++++++++-------
 1 file changed, 45 insertions(+), 10 deletions(-)
Signature · 1 line
2.48.1