Re: [PATCH 1/2] usb: xhci: fix isoc silent reschedule creating stream gap on CFC controllers

From: Dylan Robinson

Date: Wed May 06 2026 - 15:55:53 EST


On 5/5/26 16:32, Mathias Nyman wrote:
> Agreed, setting start_frame to start_frame_id + 1 would only make sense for the very first URB, otherwise we create glitches.
>
> Looks like the whole start_frame_id calculation is incorrect.

I'd also like to call attention to the fact that index in
xhci_get_isoc_frame_id() refers to the isoc packet index within the
URB, not the position of the transfer in the overall stream. A driver
could (although probably shouldn't) submit multiple URBs, each
describing less than a microframe's worth of transfers, so index == 0
does not guarantee that the computation is for a frame-aligned
transfer.

Additionally, urb->start_frame is initially computed in
xhci_queue_isoc_tx_prepare(), and in the current implementation it is
validated, and potentially modified again in xhci_get_isoc_frame_id().
It is worth considering that xhci_queue_isoc_tx_prepare() computes a
start frame close to the current IST, and if the system is preempted
before xhci_queue_isoc_tx() runs and calls xhci_get_isoc_frame_id(),
that start frame may already fall outside the valid scheduling window.