Skip to content

Commit 67ab841

Browse files
l1kgregkh
authored andcommitted
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: Lukas Wunner <lukas@wunner.de> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20231019102924.2797346-8-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 35899f5 commit 67ab841

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/usb/host/xhci-mem.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ static void xhci_link_rings(struct xhci_hcd *xhci, struct xhci_ring *ring,
146146
xhci_link_segments(last, next, ring->type, chain_links);
147147
ring->num_segs += num_segs;
148148

149-
if (ring->type != TYPE_EVENT && ring->enq_seg == ring->last_seg) {
150-
ring->last_seg->trbs[TRBS_PER_SEGMENT-1].link.control
151-
&= ~cpu_to_le32(LINK_TOGGLE);
152-
last->trbs[TRBS_PER_SEGMENT-1].link.control
153-
|= cpu_to_le32(LINK_TOGGLE);
149+
if (ring->enq_seg == ring->last_seg) {
150+
if (ring->type != TYPE_EVENT) {
151+
ring->last_seg->trbs[TRBS_PER_SEGMENT-1].link.control
152+
&= ~cpu_to_le32(LINK_TOGGLE);
153+
last->trbs[TRBS_PER_SEGMENT-1].link.control
154+
|= cpu_to_le32(LINK_TOGGLE);
155+
}
154156
ring->last_seg = last;
155157
}
156158

0 commit comments

Comments
 (0)