Commit 67ab841a authored by Lukas Wunner's avatar Lukas Wunner Committed by Greg Kroah-Hartman

xhci: Update last segment pointer after Event Ring expansion

When expanding a ring at its "end", ring->last_seg needs to be updated
for Event Rings as well, not just for all the other ring types.

This is not a fix because ring expansion currently isn't done on the
Event Ring.  It's just in preparation for when it's added.
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20231019102924.2797346-8-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35899f58
...@@ -146,11 +146,13 @@ static void xhci_link_rings(struct xhci_hcd *xhci, struct xhci_ring *ring, ...@@ -146,11 +146,13 @@ static void xhci_link_rings(struct xhci_hcd *xhci, struct xhci_ring *ring,
xhci_link_segments(last, next, ring->type, chain_links); xhci_link_segments(last, next, ring->type, chain_links);
ring->num_segs += num_segs; ring->num_segs += num_segs;
if (ring->type != TYPE_EVENT && ring->enq_seg == ring->last_seg) { if (ring->enq_seg == ring->last_seg) {
ring->last_seg->trbs[TRBS_PER_SEGMENT-1].link.control if (ring->type != TYPE_EVENT) {
&= ~cpu_to_le32(LINK_TOGGLE); ring->last_seg->trbs[TRBS_PER_SEGMENT-1].link.control
last->trbs[TRBS_PER_SEGMENT-1].link.control &= ~cpu_to_le32(LINK_TOGGLE);
|= cpu_to_le32(LINK_TOGGLE); last->trbs[TRBS_PER_SEGMENT-1].link.control
|= cpu_to_le32(LINK_TOGGLE);
}
ring->last_seg = last; ring->last_seg = last;
} }
......
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