[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250326173838.4617-1-francesco@dolcini.it>
Date: Wed, 26 Mar 2025 18:38:38 +0100
From: Francesco Dolcini <francesco@...cini.it>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>
Cc: Emanuele Ghidoli <emanuele.ghidoli@...adex.com>,
linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Marek Vasut <marek.vasut@...il.com>,
stable@...r.kernel.org,
Francesco Dolcini <francesco.dolcini@...adex.com>
Subject: [PATCH v1] gpio: pca953x: fix IRQ storm on system wake up
From: Emanuele Ghidoli <emanuele.ghidoli@...adex.com>
If an input changes state during wake-up and is used as an interrupt
source, the IRQ handler reads the volatile input register to clear the
interrupt mask and deassert the IRQ line. However, the IRQ handler is
triggered before access to the register is granted, causing the read
operation to fail.
As a result, the IRQ handler enters a loop, repeatedly printing the
"failed reading register" message, until `pca953x_resume` is eventually
called, which restores the driver context and enables access to
registers.
Fix by using DEFINE_NOIRQ_DEV_PM_OPS which ensures that `pca953x_resume`
is called before the IRQ handler is called.
Fixes: b76574300504 ("gpio: pca953x: Restore registers after suspend/resume cycle")
Cc: stable@...r.kernel.org
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@...adex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@...adex.com>
---
drivers/gpio/gpio-pca953x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index d63c1030e6ac..d39bdc125cfc 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1252,7 +1252,7 @@ static int pca953x_resume(struct device *dev)
return ret;
}
-static DEFINE_SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);
+static DEFINE_NOIRQ_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);
/* convenience to stop overlong match-table lines */
#define OF_653X(__nrgpio, __int) ((void *)(__nrgpio | PCAL653X_TYPE | __int))
--
2.39.5
Powered by blists - more mailing lists