usb: xhci: rename 'irq_pending' to 'iman'
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 15 May 2025 13:56:18 +0000 (16:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 10:35:33 +0000 (12:35 +0200)
The Interrupt Register Set contains Interrupt Management register (IMAN).
The IMAN register contains the following fields:
 - Bit 0: Interrupt Pending (IP)
 - Bit 1: Interrupt Enable (IE)
 - Bits 31:2: RsvdP (Reserved and Preserved)

Tn the xhci driver, the pointer currently named 'irq_pending' refers to the
IMAN register. However, the name "irq_pending" only describes one of the
fields within the IMAN register, rather than the entire register itself.
To improve clarity and better align with the xHCI specification,
the pointer is renamed to 'iman'.

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-22-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index 1cae4ec6c7e9d47a88b72ce840c1e5f2316a9f9c..e038ad3375dc91244f5c9fd202cbbfb4188d12b6 100644 (file)
@@ -3082,14 +3082,14 @@ void xhci_update_erst_dequeue(struct xhci_hcd *xhci,
 static void xhci_clear_interrupt_pending(struct xhci_interrupter *ir)
 {
        if (!ir->ip_autoclear) {
-               u32 irq_pending;
+               u32 iman;
 
-               irq_pending = readl(&ir->ir_set->irq_pending);
-               irq_pending |= IMAN_IP;
-               writel(irq_pending, &ir->ir_set->irq_pending);
+               iman = readl(&ir->ir_set->iman);
+               iman |= IMAN_IP;
+               writel(iman, &ir->ir_set->iman);
 
                /* Read operation to guarantee the write has been flushed from posted buffers */
-               readl(&ir->ir_set->irq_pending);
+               readl(&ir->ir_set->iman);
        }
 }
 
index 6c4bbabc3a70e215223e040a37221a8225a86e90..3450762fc7bd1ab9a9920c5c12c5c345ccf67f26 100644 (file)
@@ -330,12 +330,12 @@ int xhci_enable_interrupter(struct xhci_interrupter *ir)
        if (!ir || !ir->ir_set)
                return -EINVAL;
 
-       iman = readl(&ir->ir_set->irq_pending);
+       iman = readl(&ir->ir_set->iman);
        iman |= IMAN_IE;
-       writel(iman, &ir->ir_set->irq_pending);
+       writel(iman, &ir->ir_set->iman);
 
        /* Read operation to guarantee the write has been flushed from posted buffers */
-       readl(&ir->ir_set->irq_pending);
+       readl(&ir->ir_set->iman);
        return 0;
 }
 
@@ -346,11 +346,11 @@ int xhci_disable_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
        if (!ir || !ir->ir_set)
                return -EINVAL;
 
-       iman = readl(&ir->ir_set->irq_pending);
+       iman = readl(&ir->ir_set->iman);
        iman &= ~IMAN_IE;
-       writel(iman, &ir->ir_set->irq_pending);
+       writel(iman, &ir->ir_set->iman);
 
-       iman = readl(&ir->ir_set->irq_pending);
+       iman = readl(&ir->ir_set->iman);
        if (iman & IMAN_IP)
                xhci_dbg(xhci, "%s: Interrupt pending\n", __func__);
 
@@ -834,7 +834,7 @@ static void xhci_save_registers(struct xhci_hcd *xhci)
                ir->s3_erst_size = readl(&ir->ir_set->erst_size);
                ir->s3_erst_base = xhci_read_64(xhci, &ir->ir_set->erst_base);
                ir->s3_erst_dequeue = xhci_read_64(xhci, &ir->ir_set->erst_dequeue);
-               ir->s3_irq_pending = readl(&ir->ir_set->irq_pending);
+               ir->s3_iman = readl(&ir->ir_set->iman);
                ir->s3_irq_control = readl(&ir->ir_set->irq_control);
        }
 }
@@ -858,7 +858,7 @@ static void xhci_restore_registers(struct xhci_hcd *xhci)
                writel(ir->s3_erst_size, &ir->ir_set->erst_size);
                xhci_write_64(xhci, ir->s3_erst_base, &ir->ir_set->erst_base);
                xhci_write_64(xhci, ir->s3_erst_dequeue, &ir->ir_set->erst_dequeue);
-               writel(ir->s3_irq_pending, &ir->ir_set->irq_pending);
+               writel(ir->s3_iman, &ir->ir_set->iman);
                writel(ir->s3_irq_control, &ir->ir_set->irq_control);
        }
 }
index 4a4ce6784bf079d0abc3b8c520786be38d5184ae..62d12d23617f9c77aabdbc7c9f24fc01314fdd28 100644 (file)
@@ -211,7 +211,7 @@ struct xhci_op_regs {
 
 /**
  * struct xhci_intr_reg - Interrupt Register Set, v1.2 section 5.5.2.
- * @irq_pending:       IMAN - Interrupt Management Register. Used to enable
+ * @iman:              IMAN - Interrupt Management Register. Used to enable
  *                     interrupts and check for pending interrupts.
  * @irq_control:       IMOD - Interrupt Moderation Register. Used to throttle interrupts.
  * @erst_size:         ERSTSZ - Number of segments in the Event Ring Segment Table (ERST).
@@ -226,7 +226,7 @@ struct xhci_op_regs {
  * updates the dequeue pointer.
  */
 struct xhci_intr_reg {
-       __le32  irq_pending;
+       __le32  iman;
        __le32  irq_control;
        __le32  erst_size;
        __le32  rsvd;
@@ -234,7 +234,7 @@ struct xhci_intr_reg {
        __le64  erst_dequeue;
 };
 
-/* irq_pending bitmasks */
+/* iman bitmasks */
 /* bit 0 - Interrupt Pending (IP), whether there is an interrupt pending. Write-1-to-clear. */
 #define        IMAN_IP                 (1 << 0)
 /* bit 1 - Interrupt Enable (IE), whether the interrupter is capable of generating an interrupt */
@@ -1452,7 +1452,7 @@ struct xhci_interrupter {
        bool                    ip_autoclear;
        u32                     isoc_bei_interval;
        /* For interrupter registers save and restore over suspend/resume */
-       u32     s3_irq_pending;
+       u32     s3_iman;
        u32     s3_irq_control;
        u32     s3_erst_size;
        u64     s3_erst_base;