]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xhci: Add helper to find trb from its dma address
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 19 Nov 2025 14:23:56 +0000 (16:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Nov 2025 13:52:59 +0000 (14:52 +0100)
commitfad902d6709e349babe8fc79550552512facac30
tree22259c5fd8c47e0ca99db7dd7876a2a1d8000f3e
parent8d34983720155b8f05de765f0183d9b0e1345cc0
xhci: Add helper to find trb from its dma address

Add a xhci_dma_to_trb() helper, and use it to find the transfer TRB
early in handle_tx_event() based on the dma address found in the
event TRB.

With this helper we can avoid using 'ep_seg' transfer TRB segment
variable as both a a boolean to indicate if the transfer TRB is part
of the next queued TD, and to actually find the transfer TRB based
on ep_seg and ep_trb_dma.

This is a first step in reworking and cleaning up trb_in_td() and
handle_tx_event()

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20251119142417.2820519-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c