Hi (squashing and modifying the two top posted emails a bit to make this more readable) On 28.2.2023 6.37, Fengyi WU wrote:
We followed your suggestion and tried to add this patch to the 5.4 kernel,nothing has changed. 36dc01657b49 usb: host: xhci: Support running urb giveback in tasklet context We also adjusted the xhci interrupt moderation interval (IMODI) from 40000 to 10000. Nothing changed either. And we are thinking to try the 5.5 kernel next, but not sure if this will make any difference or not.
I'd recommend trying a more recent upstream 6.1 or 6.2 kernel
We do tried the ubuntu kernel 5.4, it was working without any problem as I mentioned.
If the problem is only visible with a custom NXP kernel then there isn't much I can do.
Let me give you more info, so we can debug and analysis together. I did a trace using the command below, can you check the atttached trace file? echo 81920 > /sys/kernel/debug/tracing/buffer_size_kb echo 1 > /sys/kernel/debug/tracing/events/xhci-hcd/enable I do found Event Ring Full Error inside the trace file.
Trace shows there are a lot of isoc TRBs with BEI (Block Event Interrupt) flag queued. These will fill the event ring with transfer events without issuing interrupts. Did setting the XHCI_AVOID_BEI flag for this host help? An more reasonable interrupt rate can be achieved by setting both XHCI_AVOID_BEI flag, and adding: "edc649a82341 xhci: Tune interrupt blocking for isochronous transfers" from 5.10 kernel. This in addition to "36dc01657b49 usb: host: xhci: Support running urb giveback in tasklet context" and the patch by Peter Chen mentioned earlier Thanks Mathias