asahi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Hector Martin <marcan@marcan.st>
To: Bin Meng <bmeng.cn@gmail.com>, Marek Vasut <marex@denx.de>
Cc: Mark Kettenis <kettenis@openbsd.org>, Neal Gompa <neal@gompa.dev>,
	 u-boot@lists.denx.de, asahi@lists.linux.dev,
	 Hector Martin <marcan@marcan.st>
Subject: [PATCH 0/2] USB fixes: (Re)implement timeouts
Date: Sun, 29 Oct 2023 16:36:15 +0900	[thread overview]
Message-ID: <20231029-usb-fixes-5-v1-0-54bb13001f54@marcan.st> (raw)

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/20231029-usb-fixes-1-v2-0-623533f6316e@marcan.st/

Signed-off-by: Hector Martin <marcan@marcan.st>
---
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,
-- 
Hector Martin <marcan@marcan.st>


             reply	other threads:[~2023-10-29  7:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-29  7:36 Hector Martin [this message]
2023-10-29  7:36 ` [PATCH 1/2] usb: Pass through timeout to drivers Hector Martin
2023-10-29 11:36   ` Marek Vasut
2023-10-29 11:43   ` Marek Vasut
2023-10-29  7:36 ` [PATCH 2/2] usb: xhci: Hook up timeouts Hector Martin
2023-10-29 11:38   ` Marek Vasut
2023-10-29 11:35 ` [PATCH 0/2] USB fixes: (Re)implement timeouts Marek Vasut
2023-10-29 14:39 ` Neal Gompa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231029-usb-fixes-5-v1-0-54bb13001f54@marcan.st \
    --to=marcan@marcan.st \
    --cc=asahi@lists.linux.dev \
    --cc=bmeng.cn@gmail.com \
    --cc=kettenis@openbsd.org \
    --cc=marex@denx.de \
    --cc=neal@gompa.dev \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).