From: Michal Pecio <michal.pecio@gmail.com>
To: Dylan Robinson <dylan_robinson@motu.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>,
linux-usb@vger.kernel.org, mathias.nyman@intel.com,
stern@rowland.harvard.edu
Subject: Re: [RFT PATCH] xhci: fix frame id calculation for isoc transfer
Date: Mon, 18 May 2026 09:13:27 +0200 [thread overview]
Message-ID: <20260518091327.470d8fb5.michal.pecio@gmail.com> (raw)
In-Reply-To: <CA+Df+jc=z96K52NJ6YXG4x8gK95udcbFHs=0hTQS6cm1r8z0zw@mail.gmail.com>
On Fri, 15 May 2026 14:13:14 -0400, Dylan Robinson wrote:
> On Fri, May 15, 2026 at 12:32 AM Michal Pecio wrote:
> > Did you try with short enough playback buffer to get occasional xHCI
> > ring underruns?
> >
> > Is Frame ID still correct then?
>
> Good point, no, it does not remain correct.
>
> I repeated the test using 1-microframe-long URBs in order to induce
> ring underruns/overruns.
Underruns are the most important thing to test here, both with CFC and
without. Under normal conditions these patches have no effect (besides
possibility of blatant bugs), but when the ring underruns we want to
know how the HW and SW will react to it.
> When the URB_ISO_ASAP flag is not set, urb->start_frame is initially
> accurate, but drifts further and further off following each ring
> underrun/overrun event. In the completion handler, urb->start_frame
> appears to remain continuous with the previous URB even after
> underrun/overrun events occur. The URB completion status and the
> isochronous frame descriptor statuses always report success.
Yes, this is very annoying because it's undetectable (without CFC).
It seems we need to handle Ring Underrun/Overrun events, somehow.
So far the only successful handling I found was to delay completion of
the next URB by 1ms, which caused snd-usb-audio to underrun its buffer
and restart the stream :)
I also tried:
1. Violate the 1.0 spec and write Frame IDs instead of SIA to all TDs.
HCs respond oddly, some skip more than they should, some get stuck when
Frame ID is in the past (probably wait for MFINDEX overflow).
2. Queue initial TDs of the next URB as No-Op TRBs and use Frame ID in
the first TD which meets IST. But HCs handle isoc No-Op TDs oddly too:
- Renesas ignores Frame ID in an Isoch TD following a No-Op TD
- Fresco executes only one No-Op per interval
- VIA re-runs the No-Os sequence each interval until Frame ID is met
in the subsequent Isoch TD
3. Don't queue inital TDs at all. This turns out to violate assumptions
made in various parts of the driver. PITA, WiP, kernel panics etc.
Regards,
Michal
next prev parent reply other threads:[~2026-05-18 7:13 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 21:25 [Bug 220748] New: usb: xhci_queue_isoc_tx_prepare ignore start_frame and always assumes URB_ISO_ASAP is set bugzilla-daemon
2025-11-05 8:40 ` [Bug 220748] " bugzilla-daemon
2025-11-05 8:48 ` bugzilla-daemon
2025-11-05 8:53 ` bugzilla-daemon
2025-11-05 9:06 ` bugzilla-daemon
2025-11-05 15:47 ` bugzilla-daemon
2025-11-05 18:28 ` bugzilla-daemon
2025-11-05 18:30 ` bugzilla-daemon
2025-11-05 20:16 ` bugzilla-daemon
2025-11-05 21:18 ` bugzilla-daemon
2025-11-06 3:52 ` bugzilla-daemon
2025-11-06 8:27 ` bugzilla-daemon
2025-11-06 8:35 ` bugzilla-daemon
2025-11-06 15:03 ` bugzilla-daemon
2025-11-08 10:33 ` bugzilla-daemon
2025-11-08 16:09 ` bugzilla-daemon
2025-11-10 10:23 ` bugzilla-daemon
2025-11-10 10:42 ` bugzilla-daemon
2026-05-04 23:53 ` bugzilla-daemon
2026-05-04 23:54 ` bugzilla-daemon
2026-05-05 1:14 ` bugzilla-daemon
2026-05-05 9:59 ` bugzilla-daemon
2026-05-05 17:09 ` bugzilla-daemon
2026-05-05 17:10 ` bugzilla-daemon
2026-05-05 17:10 ` bugzilla-daemon
2026-05-05 17:13 ` bugzilla-daemon
2026-05-06 13:32 ` bugzilla-daemon
2026-05-06 15:03 ` bugzilla-daemon
2026-05-07 2:38 ` Alan Stern
2026-05-07 16:17 ` Dylan Robinson
2026-05-07 17:24 ` Alan Stern
2026-05-07 21:16 ` Dylan Robinson
2026-05-08 3:02 ` Alan Stern
2026-05-08 17:20 ` Dylan Robinson
2026-05-09 1:25 ` Alan Stern
2026-05-09 22:12 ` Michal Pecio
2026-05-10 12:39 ` Dylan Robinson
2026-05-11 19:21 ` [RFT PATCH] xhci: fix frame id calculation for isoc transfer Mathias Nyman
2026-05-11 19:36 ` Mathias Nyman
2026-05-12 9:08 ` Michal Pecio
2026-05-13 14:30 ` Mathias Nyman
2026-05-13 14:35 ` [RFT PATCHv2 1/2] xhci: fix frame id calculation and checks for isoc URBs Mathias Nyman
2026-05-13 14:35 ` [RFT PATCHv2 2/2] xhci: Set frame ID field of isoc TRB when starting an isoch stream Mathias Nyman
2026-05-14 21:16 ` [RFT PATCH] xhci: fix frame id calculation for isoc transfer Dylan Robinson
2026-05-14 22:10 ` Dylan Robinson
2026-05-15 4:32 ` Michal Pecio
2026-05-15 18:13 ` Dylan Robinson
2026-05-18 7:13 ` Michal Pecio [this message]
2026-05-21 14:20 ` Dylan Robinson
2026-05-21 15:24 ` Mathias Nyman
2026-05-21 15:27 ` [RFT PATCHv3 1/3] xhci: fix frame id calculation and checks for isoc URBs Mathias Nyman
2026-05-21 15:27 ` [RFT PATCHv3 2/3] xhci: Set frame ID field of isoc TRB when starting an isoch stream Mathias Nyman
2026-05-21 15:27 ` [RFT PATCHv3 3/3] xhci: tune urb->start_frame in ring overrun and underrun cases Mathias Nyman
2026-05-07 21:54 ` [Bug 220748] usb: xhci_queue_isoc_tx_prepare ignore start_frame and always assumes URB_ISO_ASAP is set Michal Pecio
2026-05-08 3:09 ` Alan Stern
2026-05-08 9:41 ` Michal Pecio
2026-05-08 14:54 ` Alan Stern
2026-05-08 21:39 ` Dylan Robinson
2026-05-09 11:10 ` Michal Pecio
2026-05-09 20:18 ` Dylan Robinson
2026-05-11 19:15 ` bugzilla-daemon
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=20260518091327.470d8fb5.michal.pecio@gmail.com \
--to=michal.pecio@gmail.com \
--cc=dylan_robinson@motu.com \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
--cc=mathias.nyman@linux.intel.com \
--cc=stern@rowland.harvard.edu \
/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