[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250313170856.20868-3-rengarajan.s@microchip.com>
Date: Thu, 13 Mar 2025 22:38:56 +0530
From: Rengarajan S <rengarajan.s@...rochip.com>
To: <vaibhaavram.tl@...rochip.com>, <kumaravel.thiagarajan@...rochip.com>,
<arnd@...db.de>, <gregkh@...uxfoundation.org>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <unglinuxdriver@...rochip.com>
CC: <rengarajan.s@...rochip.com>
Subject: [PATCH v1 char-misc-linus 2/2] misc: microchip: pci1xxxx: Fix incorrect IRQ status handling during ack
Under irq_ack, pci1xxxx_assign_bit reads the current interrupt status,
modifies and writes the entire value back. Since, the IRQ status bit
gets cleared on writing back, the better approach is to directly write
the bitmask to the register in order to preserve the value.
Fixes: 1f4d8ae231f4 ("misc: microchip: pci1xxxx: Add gpio irq handler and irq helper functions irq_ack, irq_mask, irq_unmask and irq_
set_type of irq_chip.")
Signed-off-by: Rengarajan S <rengarajan.s@...rochip.com>
---
drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
index 88a405b72125..55b892f982e9 100644
--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
+++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gpio.c
@@ -165,7 +165,7 @@ static void pci1xxxx_gpio_irq_ack(struct irq_data *data)
unsigned long flags;
spin_lock_irqsave(&priv->lock, flags);
- pci1xxx_assign_bit(priv->reg_base, INTR_STAT_OFFSET(gpio), (gpio % 32), true);
+ writel(BIT(gpio % 32), priv->reg_base + INTR_STAT_OFFSET(gpio));
spin_unlock_irqrestore(&priv->lock, flags);
}
--
2.25.1
Powered by blists - more mailing lists