Commit e2d3ac9c authored by Mathias Nyman's avatar Mathias Nyman Committed by Greg Kroah-Hartman

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: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231019102924.2797346-4-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 15626ba9
...@@ -144,7 +144,7 @@ static void next_trb(struct xhci_hcd *xhci, ...@@ -144,7 +144,7 @@ static void next_trb(struct xhci_hcd *xhci,
struct xhci_segment **seg, struct xhci_segment **seg,
union xhci_trb **trb) union xhci_trb **trb)
{ {
if (trb_is_link(*trb)) { if (trb_is_link(*trb) || last_trb_on_seg(*seg, *trb)) {
*seg = (*seg)->next; *seg = (*seg)->next;
*trb = ((*seg)->trbs); *trb = ((*seg)->trbs);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment