From: Michal Pecio <michal.pecio@gmail.com>
To: Mathias Nyman <mathias.nyman@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 0/3] xhci: ring queuing cleanups
Date: Thu, 20 Feb 2025 23:43:55 +0100 [thread overview]
Message-ID: <20250220234355.2386cb6d@foxbook> (raw)
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(-)
--
2.48.1
next reply other threads:[~2025-02-20 22:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 22:43 Michal Pecio [this message]
2025-02-20 22:44 ` [PATCH 1/3] usb: xhci: Simplify update_ring_for_set_deq_completion() Michal Pecio
2025-02-21 13:23 ` Mathias Nyman
2025-03-05 8:24 ` Michał Pecio
2025-02-20 22:46 ` [PATCH 2/3] usb: xhci: Simplify moving HW Dequeue Pointer past cancelled TDs Michal Pecio
2025-02-20 22:47 ` [PATCH 3/3] usb: xhci: Unify duplicate inc_enq() code Michal Pecio
2025-02-21 14:54 ` Mathias Nyman
2025-02-23 23:45 ` Michał Pecio
2025-02-24 11:49 ` Mathias Nyman
2025-02-24 21:01 ` Michał Pecio
2025-02-25 9:33 ` Mathias Nyman
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=20250220234355.2386cb6d@foxbook \
--to=michal.pecio@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
/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