]> www.infradead.org Git - linux.git/commitdiff
usb: xhci: rework Event Ring Segment Table Size mask
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 15 May 2025 13:56:15 +0000 (16:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 10:35:33 +0000 (12:35 +0200)
Event Ring Segment Table Size Register contain two fields:
 - Bits 15:0: Event Ring Segment Table Size
 - Bits 31:16: RsvdZ (Reserved and Zero)

The current mask 'ERST_SIZE_MASK' refers to the RsvdZ bits (31:16).
Change the mask to refer to bits 15:0, which are the Event Ring Segment
Table Size bits.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20250515135621.335595-19-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mem.c
drivers/usb/host/xhci.h

index dcfe7774e9ed256bdb9376d69de94d9ae98eaedd..ec2c4851c6892963575d9b003fed502ea9049906 100644 (file)
@@ -1831,7 +1831,7 @@ xhci_remove_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
         */
        if (ir->ir_set) {
                tmp = readl(&ir->ir_set->erst_size);
-               tmp &= ERST_SIZE_MASK;
+               tmp &= ~ERST_SIZE_MASK;
                writel(tmp, &ir->ir_set->erst_size);
 
                xhci_update_erst_dequeue(xhci, ir, true);
@@ -2333,7 +2333,7 @@ void xhci_add_interrupter(struct xhci_hcd *xhci, unsigned int intr_num)
 
        /* set ERST count with the number of entries in the segment table */
        erst_size = readl(&ir->ir_set->erst_size);
-       erst_size &= ERST_SIZE_MASK;
+       erst_size &= ~ERST_SIZE_MASK;
        erst_size |= ir->event_ring->num_segs;
        writel(erst_size, &ir->ir_set->erst_size);
 
index fc6b97add7fad0fbc25369074d799a1854182d3f..19dd47d761407296cf2270cca6deb50937a16994 100644 (file)
@@ -251,8 +251,8 @@ struct xhci_intr_reg {
 #define ER_IRQ_COUNTER_MASK    (0xffff << 16)
 
 /* erst_size bitmasks */
-/* Preserve bits 16:31 of erst_size */
-#define        ERST_SIZE_MASK          (0xffff << 16)
+/* bits 15:0 - Event Ring Segment Table Size, number of ERST entries */
+#define        ERST_SIZE_MASK          (0xffff)
 
 /* erst_base bitmasks */
 #define ERST_BASE_RSVDP                (GENMASK_ULL(5, 0))