[PATCH] usb: xhci: Slightly simplify xhci_set_cmd_ring_deq()

Michal Pecio <[email protected]> Thu, 30 Jul 2026 11:04:30 +0200
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
There is no need to clear the cycle bit after adding deq_dma, because
it's never set there. Clear it together with the dequeue pointer.

Signed-off-by: Michal Pecio <[email protected]>
---
 drivers/usb/host/xhci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index a58a9a5b487f..dece11ffc0e6 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -495,10 +495,8 @@ static void xhci_set_cmd_ring_deq(struct xhci_hcd *xhci)
 	deq_dma &= CMD_RING_PTR_MASK;
 
 	crcr = xhci_read_64(xhci, &xhci->op_regs->cmd_ring);
-	crcr &= ~CMD_RING_PTR_MASK;
+	crcr &= ~(CMD_RING_PTR_MASK | CMD_RING_CYCLE);
 	crcr |= deq_dma;
-
-	crcr &= ~CMD_RING_CYCLE;
 	crcr |= xhci->cmd_ring->cycle_state;
 
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Setting command ring address to 0x%llx", crcr);
-- 
2.48.1