Skip to content

Commit e2d3ac9

Browse files
matnymangregkh
authored andcommitted
xhci: expand next_trb() helper to support more ring types
The next_trb() helper relies on a link TRB at the end of a ring segment to know a segment ends. This works well with transfer rings that use link trbs, but not with event rings. Event rings segments are always filled by host to segment size before moving to next segment. It does not use link TRBs Check for both link trb and full segment in next_trb() helper to support event rings. Useful if several interrupters with several event rings are supported. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20231019102924.2797346-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 15626ba commit e2d3ac9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void next_trb(struct xhci_hcd *xhci,
144144
struct xhci_segment **seg,
145145
union xhci_trb **trb)
146146
{
147-
if (trb_is_link(*trb)) {
147+
if (trb_is_link(*trb) || last_trb_on_seg(*seg, *trb)) {
148148
*seg = (*seg)->next;
149149
*trb = ((*seg)->trbs);
150150
} else {

0 commit comments

Comments
 (0)