From bf9cce90da311aae5723681d74495099e417e8c7 Mon Sep 17 00:00:00 2001 From: Niklas Neronin Date: Thu, 15 May 2025 16:56:18 +0300 Subject: [PATCH] usb: xhci: rename 'irq_pending' to 'iman' 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 Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20250515135621.335595-22-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-ring.c | 10 +++++----- drivers/usb/host/xhci.c | 16 ++++++++-------- drivers/usb/host/xhci.h | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 1cae4ec6c7e9..e038ad3375dc 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -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); } } diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 6c4bbabc3a70..3450762fc7bd 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -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); } } diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 4a4ce6784bf0..62d12d23617f 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -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; -- 2.25.1