Skip to content

Commit 33b2831

Browse files
author
Sarah Sharp
committed
xhci: Reset reserved command ring TRBs on cleanup.
When the xHCI driver needs to clean up memory (perhaps due to a failed register restore on resume from S3 or resume from S4), it needs to reset the number of reserved TRBs on the command ring to zero. Otherwise, several resume cycles (about 30) with a UAS device attached will continually increment the number of reserved TRBs, until all command submissions fail because there isn't enough room on the command ring. This patch should be backported to kernels as old as 2.6.32, that contain the commit 913a8a3 "USB: xhci: Change how xHCI commands are handled." Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
1 parent f8a9e72 commit 33b2831

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/host/xhci-mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,6 +1815,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
18151815
xhci->event_ring = NULL;
18161816
xhci_dbg(xhci, "Freed event ring\n");
18171817

1818+
xhci->cmd_ring_reserved_trbs = 0;
18181819
if (xhci->cmd_ring)
18191820
xhci_ring_free(xhci, xhci->cmd_ring);
18201821
xhci->cmd_ring = NULL;

0 commit comments

Comments
 (0)