From: Stephano Cetola <stephano@cetola.net>
To: Sascha Hauer <s.hauer@pengutronix.de>,
"open list:BAREBOX" <barebox@lists.infradead.org>
Subject: [PATCH 5/5] usb: xhci: wait a real interval for interrupt endpoint transfers
Date: Sat, 22 Aug 2026 15:34:04 -0700 [thread overview]
Message-ID: <20260822-send-xhci-fixes-v1-5-22e1de3be715@cetola.net> (raw)
In-Reply-To: <20260822-send-xhci-fixes-v1-0-22e1de3be715@cetola.net>
_xhci_submit_int_msg() ignored its interval parameter and always
waited 0ms for the transfer to complete. With a 0ms wait,
xhci_wait_for_event() does essentially a single instant check of the
event ring and gives up if nothing is pending yet, then abort_td()
cancels the just-queued transfer.
The xHC polls the device autonomously at the endpoint's bInterval
once a TRB is queued and the doorbell is rung, entirely in hardware,
independent of how long the driver waits. A 0ms wait cancels that
transfer before the hardware's own polling cycle ever gets a chance
to complete, even when the device has real data ready to send. Every
call would time out regardless of actual device state.
Because abort_td()'s own cleanup commands wait on a real timeout,
five seconds, not the caller's zero, the aborted transfer is often
still racing the hardware's actual response when the driver moves
on. Some polls still pick up real data by accident. The result reads
as intermittent. A keypress sometimes registers and sometimes
doesn't, rather than a clean, consistent failure.
Signed-off-by: Stephano Cetola <stephano@cetola.net>
---
drivers/usb/host/xhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 27d4353597..661dc0dde0 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1110,7 +1110,7 @@ static int _xhci_submit_int_msg(struct usb_device *udev, unsigned long pipe,
* (at most) one TD. A TD (comprised of sg list entries) can
* take several service intervals to transmit.
*/
- return xhci_bulk_tx(udev, pipe, length, buffer, 0);
+ return xhci_bulk_tx(udev, pipe, length, buffer, interval);
}
/**
--
2.55.0
next prev parent reply other threads:[~2026-08-22 22:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 22:33 [PATCH 0/5] usb: xhci: fix endpoint halt and stall recovery Stephano Cetola
2026-08-22 22:34 ` [PATCH 1/5] usb: xhci: tolerate COMP_CTX_STATE in abort_td's final completion check Stephano Cetola
2026-08-22 22:34 ` [PATCH 2/5] usb: xhci: reset_ep: wait for real completion, not the caller's timeout Stephano Cetola
2026-08-22 22:34 ` [PATCH 3/5] usb: xhci: reset_ep: fix misaligned pointer in Set TR Dequeue Pointer Stephano Cetola
2026-08-22 22:34 ` [PATCH 4/5] usb: xhci: xhci_bulk_tx: re-fetch ep_ctx after resetting a halted endpoint Stephano Cetola
2026-08-22 22:34 ` Stephano Cetola [this message]
2026-08-24 10:14 ` [PATCH 0/5] usb: xhci: fix endpoint halt and stall recovery Sascha Hauer
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=20260822-send-xhci-fixes-v1-5-22e1de3be715@cetola.net \
--to=stephano@cetola.net \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.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