On 23.8.2024 14.43, FPS wrote:
On Wed, Aug 21, 2024 at 05:15:00PM +0300, Mathias Nyman wrote: > My best guess is that these are caused by a full xhci event ring. > > If event ring is full it would stop transfer rings, and we would see > missed service events. This matches the logs. > > The events get handled and cleared in the interrupt handler, but > not every event generates an interrupt. for isoc transfers we intentionally > block a lot of event triggered interrupts. This has piqued my interest. Can you point me to the code in the kernel source where this filtering happens?
When a transfer completes the xHC hw will add an event on the event ring pointing to this completed transfer block (TRB), and trigger an interrupt. We can prevent xHC from generating the interrupt by setting a BEI (Block Event Interrupt) flag in the Transfer Block (TRB) To make sure every event triggers an interrupt just comment out: diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 4ea2c3e072a9..de61a1018155 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -4108,8 +4108,8 @@ static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags, td->last_trb = ep_ring->enqueue; td->last_trb_seg = ep_ring->enq_seg; field |= TRB_IOC; - if (trb_block_event_intr(xhci, num_tds, i, ir)) - field |= TRB_BEI; +// if (trb_block_event_intr(xhci, num_tds, i, ir)) +// field |= TRB_BEI; But I don't think this is the issue after looking at the traces. Thanks Mathias