Skip to content

xhci: ring queuing cleanups

Michal Pecio linux-usb lkml 1 version In review

Get series with b4
b4 am 20250220234355.2386cb6d@foxbook

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3usb: xhci: Simplify update_ring_for_set_deq_completion()drivers/usb/host/xhci-ring.c+16 -272 replies
2/3usb: xhci: Simplify moving HW Dequeue Pointer past cancelled TDsdrivers/usb/host/xhci-ring.c+18 -460 replies
3/3usb: xhci: Unify duplicate inc_enq() codedrivers/usb/host/xhci-ring.c+58 -775 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] xhci: ring queuing cleanups

Hi,

I was looking at all uses of enqueue/dequeue pointers and I found two rather complex loops which appear to be doing really simple things.

I don't understand why they were written this way, it seems wasteful and I see nothing that should go wrong if they are replaced with much simpler code.

I rewrote them and the driver still works. I exercised Set TR Dequeue code by starting/stopping isoc streams, using usb-storage with crappy cable (transaction errors, halts) and also the smartctl -x trick that results in URB unlinks (both on usb-storage and uas) with some disks.

The third patch is a dedupe. BTW, that comment there about section 6.4.4.1 of the 0.95 spec seems to be wrong, I suspect it should say that the chain bit cannot be *cleared* because that's how the code works and what some commit messages say. But I don't have 0.95 spec.

Regards,
Michal

Michal Pecio (3):
usb: xhci: Simplify update_ring_for_set_deq_completion()
usb: xhci: Simplify moving HW Dequeue Pointer past cancelled TDs
usb: xhci: Unify duplicate inc_enq() code

 drivers/usb/host/xhci-ring.c | 242 +++++++++++++----------------------
 1 file changed, 92 insertions(+), 150 deletions(-)
Signature · 1 line
2.48.1