Skip to content

USB fixes: (Re)implement timeouts

Hector Martin asahi u-boot 1 version In review

Get series with b4
b4 am [email protected] change-id 20231029-usb-fixes-5-ca87bbedb40c

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2usb: Pass through timeout to driverscommon/usb.c drivers/usb/host/ehci-hcd.c drivers/usb/host/ohci-hcd.c +5 more+29 -372 replies
2/2usb: xhci: Hook up timeoutsdrivers/usb/host/xhci-ring.c drivers/usb/host/xhci.c include/usb/xhci.h+43 -261 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNeal GompaMarek Vasut
SeriesR-b
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] USB fixes: (Re)implement timeouts

A long time ago, the USB code was interrupt-driven and used top-level timeout handling. This has long been obsolete, and that code is just broken dead cruft. HC drivers instead hardcode timeouts today.

We need to be able to specify timeouts explicitly to handle cases like USB hard disks spinning up, without having ridiculously long timeouts across the board (which would cause endless waiting when things go wrong anywhere else). So, it's time to rip out the old broken nonsense and actually pass through timeouts to USB host controller drivers, so they can be implemented properly.

This series adds the necessary top-level scaffolding for control/bulk timeouts, and implements them in xHCI. I didn't bother with interrupt transfers, since I figure those probably never need long timeouts anyway.

The platform I deal with only has xHCI, so I'll leave implementing this for EHCI/OHCI to someone else if anyone cares :)

This series needs to be applied after [1], since the xHCI changes depend on changes made there.

[1] https://lore.kernel.org/u-boot/[email protected]/

---
Hector Martin (2):
usb: Pass through timeout to drivers
usb: xhci: Hook up timeouts

 common/usb.c                    | 21 ++-------------------
 drivers/usb/host/ehci-hcd.c     |  5 +++--
 drivers/usb/host/ohci-hcd.c     |  5 +++--
 drivers/usb/host/r8a66597-hcd.c |  5 +++--
 drivers/usb/host/usb-sandbox.c  |  6 ++++--
 drivers/usb/host/usb-uclass.c   |  9 +++++----
 drivers/usb/host/xhci-ring.c    | 32 ++++++++++++++++++++------------
 drivers/usb/host/xhci.c         | 28 ++++++++++++++++------------
 include/usb.h                   | 10 ++++++----
 include/usb/xhci.h              | 14 ++++++++++----
 10 files changed, 72 insertions(+), 63 deletions(-)

---
base-commit: 3d5d748e4d66b98109669c05d0c473fe67795801
change-id: 20231029-usb-fixes-5-ca87bbedb40c

Best regards,

Signature · 1 line
Hector Martin <[email protected]>