linux-yocto/drivers/gpio
Emanuele Ghidoli 262e32568a gpio: pca953x: fix IRQ storm on system wake up
[ Upstream commit 3e38f94606 ]

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 disabling the IRQ line before entering suspend mode, and
re-enabling it after the driver context is restored in `pca953x_resume()`.

An IRQ can be disabled with disable_irq() and still wake the system as
long as the IRQ has wake enabled, so the wake-up functionality is
preserved.

Fixes: b765743005 ("gpio: pca953x: Restore registers after suspend/resume cycle")
Cc: stable@vger.kernel.org
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20250512095441.31645-1-francesco@dolcini.it
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-04 14:40:01 +02:00
..
gpio-74x164.c gpio: 74x164: Enable output pins after registers are reset 2024-03-06 14:45:19 +00:00
gpio-74xx-mmio.c
gpio-104-dio-48e.c gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
gpio-104-idi-48.c gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
gpio-104-idio-16.c gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
gpio-adnp.c
gpio-adp5520.c
gpio-aggregator.c gpio: aggregator: protect driver attr handlers against module unload 2025-03-13 12:53:12 +01:00
gpio-altera-a10sr.c
gpio-altera.c
gpio-amd-fch.c
gpio-amd8111.c gpio: amd8111: Fix PCI device reference count leak 2022-11-30 17:18:35 +01:00
gpio-amdpt.c
gpio-arizona.c
gpio-aspeed-sgpio.c
gpio-aspeed.c gpio: aspeed: Use devm_clk api to manage clock source 2024-10-17 15:22:21 +02:00
gpio-ath79.c
gpio-bcm-kona.c gpio: bcm-kona: Add missing newline to dev_err format string 2025-02-21 13:49:58 +01:00
gpio-bd9571mwv.c
gpio-bd71815.c
gpio-bd71828.c
gpio-brcmstb.c gpio: updates for v6.0-rc1 2022-08-04 18:34:05 -07:00
gpio-bt8xx.c
gpio-cadence.c
gpio-clps711x.c
gpio-creg-snps.c
gpio-crystalcove.c gpio: crystalcove: Use -ENOTSUPP consistently 2024-05-17 11:56:09 +02:00
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: fix lazy disable 2024-10-17 15:22:02 +02:00
gpio-dln2.c
gpio-dwapb.c gpio: dwapb: mask/unmask IRQ when disable/enale it 2024-01-01 12:39:07 +00:00
gpio-eic-sprd.c gpio: eic-sprd: Clear interrupt after set the interrupt type 2024-01-31 16:17:11 -08:00
gpio-em.c
gpio-en7523.c
gpio-ep93xx.c gpio: ep93xx: Fix port F hwirq numbers in handler 2023-02-01 08:34:47 +01:00
gpio-exar.c gpio: exar: set value when external pull-up or pull-down is present 2024-12-14 19:54:01 +01:00
gpio-f7188x.c gpio-f7188x: fix chip name and pin count on Nuvoton chip 2023-06-05 09:26:18 +02:00
gpio-ftgpio010.c gpio: ftgpio010: Make irqchip immutable 2022-09-20 16:10:53 +02:00
gpio-ge.c
gpio-gpio-mm.c
gpio-grgpio.c gpio: grgpio: Add NULL check in grgpio_probe 2024-12-14 19:54:24 +01:00
gpio-gw-pld.c
gpio-hisi.c
gpio-hlwd.c
gpio-htc-egpio.c
gpio-i8255.c
gpio-i8255.h
gpio-ich.c
gpio-idt3243x.c
gpio-imx-scu.c gpio: imx-scu: add imx-scu GPIO driver 2022-08-31 17:21:23 +02:00
gpio-iop.c
gpio-it87.c
gpio-ixp4xx.c gpio: ixp4xx: Make irqchip immutable 2022-09-13 16:17:45 +02:00
gpio-janz-ttl.c
gpio-kempld.c
gpio-logicvc.c
gpio-loongson.c
gpio-loongson1.c
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c
gpio-lpc18xx.c
gpio-lpc32xx.c
gpio-madera.c
gpio-max730x.c
gpio-max732x.c
gpio-max3191x.c
gpio-max7300.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
gpio-max7301.c
gpio-max77620.c
gpio-max77650.c
gpio-mb86s7x.c
gpio-mc33880.c
gpio-menz127.c
gpio-merrifield.c
gpio-ml-ioh.c
gpio-mlxbf.c
gpio-mlxbf2.c gpio: mlxbf2: Use generic_handle_irq_safe() 2022-09-19 15:08:38 +02:00
gpio-mm-lantiq.c
gpio-mmio.c
gpio-mockup.c gpio: mockup: Fix mode of debugfs files 2023-05-30 14:03:18 +01:00
gpio-moxtet.c
gpio-mpc8xxx.c gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx 2022-09-07 13:17:23 +02:00
gpio-mpc5200.c
gpio-msc313.c
gpio-mt7621.c gpio updates for v6.1-rc1 2022-10-08 09:46:29 -07:00
gpio-mvebu.c gpio: mvebu: fix irq domain leak 2023-08-03 10:23:49 +02:00
gpio-mxc.c gpio: mxc: remove dead code after switch to DT-only 2025-02-21 13:49:21 +01:00
gpio-mxs.c
gpio-octeon.c
gpio-omap.c
gpio-palmas.c
gpio-pca953x.c gpio: pca953x: fix IRQ storm on system wake up 2025-06-04 14:40:01 +02:00
gpio-pca9570.c
gpio-pcf857x.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
gpio-pch.c
gpio-pci-idio-16.c
gpio-pcie-idio-24.c
gpio-pisosr.c
gpio-pl061.c
gpio-pmic-eic-sprd.c gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip 2023-10-06 14:56:50 +02:00
gpio-pxa.c gpio: pxa: disable pinctrl calls for MMP_GPIO 2023-10-10 22:00:45 +02:00
gpio-raspberrypi-exp.c
gpio-rc5t583.c
gpio-rcar.c gpio: rcar: Fix missing of_node_put() call 2025-03-13 12:53:19 +01:00
gpio-rda.c
gpio-rdc321x.c
gpio-realtek-otto.c gpio: realtek-otto: switch to 32-bit I/O 2022-08-31 17:46:30 +02:00
gpio-reg.c
gpio-regmap.c
gpio-rockchip.c gpio: rockchip: fix OF node leak in probe() 2024-09-12 11:10:29 +02:00
gpio-sa1100.c
gpio-sama5d2-piobu.c
gpio-sch.c
gpio-sch311x.c
gpio-sifive.c gpio: sifive: add missing check for platform_get_irq 2023-06-28 11:12:34 +02:00
gpio-sim.c gpio: sim: pass the GPIO device's software node to irq domain 2023-08-30 16:11:13 +02:00
gpio-siox.c
gpio-sl28cpld.c
gpio-sodaville.c
gpio-spear-spics.c
gpio-sprd.c
gpio-sta2x11.c
gpio-stmpe.c gpio: stmpe: Check return value of stmpe_reg_read in stmpe_gpio_irq_sync_unlock 2025-02-21 13:50:05 +01:00
gpio-stp-xway.c
gpio-syscon.c
gpio-tb10x.c gpio: tb10x: Fix an error handling path in tb10x_gpio_probe() 2023-10-06 14:56:43 +02:00
gpio-tc3589x.c gpio: tc3589x: Make irqchip immutable 2022-10-03 20:56:46 +02:00
gpio-tegra.c gpio: tegra: Convert to immutable irq chip 2022-10-20 13:47:54 +02:00
gpio-tegra186.c gpio: tegra186: fix resource handling in ACPI probe path 2025-04-25 10:43:44 +02:00
gpio-thunderx.c
gpio-timberdale.c gpio: timberdale: Fix potential deadlock on &tgpio->lock 2023-10-25 12:03:09 +02:00
gpio-tn48m.c
gpio-tpic2810.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c gpio: tps68470: Make tps68470_gpio_output() always set the initial value 2023-08-03 10:23:48 +02:00
gpio-tqmx86.c gpio: tqmx86: fix broken IRQ_TYPE_EDGE_BOTH interrupt type 2024-06-21 14:35:49 +02:00
gpio-ts4800.c
gpio-ts4900.c
gpio-ts5500.c
gpio-twl4030.c gpio: twl4030: Reorder functions which allows to drop a forward declaraion 2022-09-20 09:02:08 +02:00
gpio-twl6040.c
gpio-ucb1400.c gpio: ucb1400: Use proper header 2022-08-31 13:37:32 +02:00
gpio-uniphier.c
gpio-vf610.c gpio: vf610: mask the gpio irq in system suspend and support wakeup 2023-10-25 12:03:16 +02:00
gpio-viperboard.c
gpio-virtio.c
gpio-visconti.c
gpio-vx855.c
gpio-wcd934x.c
gpio-wcove.c gpio: wcove: Use -ENOTSUPP consistently 2024-05-17 11:56:09 +02:00
gpio-winbond.c
gpio-wm831x.c
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent 2023-08-16 18:27:29 +02:00
gpio-xgene-sb.c
gpio-xgene.c
gpio-xgs-iproc.c
gpio-xilinx.c gpio: xilinx: remove excess kernel doc 2025-02-21 13:49:54 +01:00
gpio-xlp.c
gpio-xra1403.c
gpio-xtensa.c
gpio-zevio.c
gpio-zynq.c gpio: zynq: Fix wakeup source leaks on device unbind 2025-04-25 10:43:44 +02:00
gpio-zynqmp-modepin.c gpio: modepin: Enable module autoloading 2024-09-12 11:10:29 +02:00
gpiolib-acpi.c gpiolib: acpi: Add a quirk for Acer Nitro ANV14 2025-02-21 13:50:05 +01:00
gpiolib-acpi.h gpiolib: acpi: Add wake_capable variants of acpi_dev_gpio_irq_get 2022-10-04 15:41:12 +02:00
gpiolib-cdev.c gpiolib: cdev: Fix use after free in lineinfo_changed_notify 2025-01-23 17:17:14 +01:00
gpiolib-cdev.h
gpiolib-devres.c
gpiolib-legacy.c
gpiolib-of.c gpiolib: fix OOB access in quirk callbacks 2022-09-20 08:30:57 +02:00
gpiolib-of.h
gpiolib-sysfs.c gpiolib: sysfs: Fix error handling on failed export 2023-12-13 18:39:24 +01:00
gpiolib-sysfs.h
gpiolib.c gpio: prevent potential speculation leaks in gpio_device_get_desc() 2024-09-30 16:23:55 +02:00
gpiolib.h gpiolib: protect the GPIO device against being dropped while in use by user-space 2022-12-31 13:32:42 +01:00
Kconfig gpio: tqmx86: fix typo in Kconfig label 2024-06-21 14:35:48 +02:00
Makefile Input updates for 6.1 merge window: 2022-10-11 10:53:25 -07:00
TODO