Skip to content

usb: xhci: improve trb_in_td()

Niklas Neronin linux-usb 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4usb: xhci: refactor trb_in_td() to be staticdrivers/usb/host/xhci-ring.c drivers/usb/host/xhci.h+61 -630 replies
2/4usb: xhci: move debug capabilities from trb_in_td() to handle_tx_event()drivers/usb/host/xhci-ring.c+19 -212 replies
3/4usb: xhci: rework and simplify trb_in_td()drivers/usb/host/xhci-ring.c+33 -395 replies
4/4usb: xhci: modify trb_in_td() to be more modulardrivers/usb/host/xhci-ring.c+25 -160 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/4] usb: xhci: improve trb_in_td()

Function td_in_trd() checks whether a DMA address is within the TDs boundaries. This patch set aims to simplify and improve trb_in_td().

Additionally, the rework will enable trb_in_td() (with renaming and minor modifications) to also check whether a DMA address is in a ring queue. This will be utilized in the upcoming handle_tx_event() rework.

Example of a Ring Structure:
The example segment ring is composed of three segments (A, B, C), each containing three TRBs (1, 2, 3). Any segment can serve as the start or end segment, and any TRB within the start segment can be the start TRB, and vice versa.

      +---+   +---+   +---+
C --> | A |-->| B |-->| C |--> A
      +---+   +---+   +---+
        |       |       |
      +---+   +---+   +---+
      | 1 |   | 1 |   | 1 |
      | 2 |   | 2 |   | 2 |
      | 3 |   | 3 |   | 3 |
      +---+   +---+   +---+

Niklas Neronin (4):
usb: xhci: refactor trb_in_td() to be static
usb: xhci: move debug capabilities from trb_in_td() to
handle_tx_event()
usb: xhci: rework and simplify trb_in_td()
usb: xhci: modify trb_in_td() to be more modular

 drivers/usb/host/xhci-ring.c | 143 ++++++++++++++++++-----------------
 drivers/usb/host/xhci.h      |   2 -
 2 files changed, 72 insertions(+), 73 deletions(-)
Signature · 1 line
2.47.2