From d57b67b23274037ed67f1f51d12deae05fba735c Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 4 Jan 2022 11:42:07 +0100 Subject: [PATCH] pinctrl: cherryview: Ack spurious IRQs to avoid an IRQ storm Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping. As part of this chv_gpio_irq_handler() got the following code added: if (offset == CHV_INVALID_HWIRQ) { dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line); continue; } This causes it to now correctly identify spurious IRQs, but when these happen they now cause an interrupt storm because they do not get acked. Avoid this by acking the interrupt-line before continuing with checking the next interrupt-line. This fixes some systems which have spurious IRQs during boot no longer booting. Signed-off-by: Hans de Goede --- drivers/pinctrl/intel/pinctrl-cherryview.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 8981755a5d83..fa9d0e5421b9 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1472,6 +1472,10 @@ static void chv_gpio_irq_handler(struct irq_desc *desc) offset = cctx->intr_lines[intr_line]; if (offset == CHV_INVALID_HWIRQ) { dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line); + /* Ack the interrupt-line to avoid an IRQ storm */ + raw_spin_lock_irqsave(&chv_lock, flags); + chv_pctrl_writel(pctrl, CHV_INTSTAT, BIT(intr_line)); + raw_spin_unlock_irqrestore(&chv_lock, flags); continue; } -- 2.33.1