linux/drivers/pinctrl
Sergey Matsievskiy 93b8ddc545 pinctrl: ocelot: fix system hang on level based interrupts
The current implementation only calls chained_irq_enter() and
chained_irq_exit() if it detects pending interrupts.

```
for (i = 0; i < info->stride; i++) {
	uregmap_read(info->map, id_reg + 4 * i, &reg);
	if (!reg)
		continue;

	chained_irq_enter(parent_chip, desc);
```

However, in case of GPIO pin configured in level mode and the parent
controller configured in edge mode, GPIO interrupt might be lowered by the
hardware. In the result, if the interrupt is short enough, the parent
interrupt is still pending while the GPIO interrupt is cleared;
chained_irq_enter() never gets called and the system hangs trying to
service the parent interrupt.

Moving chained_irq_enter() and chained_irq_exit() outside the for loop
ensures that they are called even when GPIO interrupt is lowered by the
hardware.

The similar code with chained_irq_enter() / chained_irq_exit() functions
wrapping interrupt checking loop may be found in many other drivers:
```
grep -r -A 10 chained_irq_enter drivers/pinctrl
```

Cc: stable@vger.kernel.org
Signed-off-by: Sergey Matsievskiy <matsievskiysv@gmail.com>
Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/20241012105743.12450-2-matsievskiysv@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2024-10-12 22:04:38 +02:00
..
actions
aspeed
bcm
berlin
cirrus
freescale
intel pinctrl: intel: platform: Add Panther Lake to the list of supported 2024-10-03 13:14:31 +03:00
mediatek
meson
mvebu
nomadik
nuvoton pinctrl: nuvoton: fix a double free in ma35_pinctrl_dt_node_to_map_func() 2024-10-11 21:54:58 +02:00
nxp
pxa
qcom
realtek
renesas
samsung
sophgo pinctrl: sophgo: fix double free in cv1800_pctrl_dt_node_to_map() 2024-10-10 21:12:59 +02:00
spear
sprd
starfive
stm32 pinctrl: stm32: check devm_kasprintf() returned value 2024-10-01 14:03:34 +02:00
sunplus
sunxi
tegra
ti
uniphier
visconti
vt8500
core.c
core.h
devicetree.c
devicetree.h
Kconfig
Makefile
pinconf-generic.c
pinconf.c
pinconf.h
pinctrl-amd.c
pinctrl-amd.h
pinctrl-apple-gpio.c pinctrl: apple: check devm_kasprintf() returned value 2024-10-01 14:03:34 +02:00
pinctrl-artpec6.c
pinctrl-as3722.c
pinctrl-at91-pio4.c
pinctrl-at91.c
pinctrl-at91.h
pinctrl-aw9523.c pinctrl: aw9523: add missing mutex_destroy 2024-10-02 15:48:38 +02:00
pinctrl-axp209.c
pinctrl-bm1880.c
pinctrl-cy8c95x0.c
pinctrl-da850-pupd.c
pinctrl-da9062.c
pinctrl-digicolor.c
pinctrl-ep93xx.c
pinctrl-equilibrium.c
pinctrl-equilibrium.h
pinctrl-eyeq5.c
pinctrl-falcon.c
pinctrl-gemini.c
pinctrl-ingenic.c
pinctrl-k210.c
pinctrl-keembay.c
pinctrl-lantiq.c
pinctrl-lantiq.h
pinctrl-loongson2.c
pinctrl-lpc18xx.c
pinctrl-max77620.c
pinctrl-mcp23s08.c
pinctrl-mcp23s08.h
pinctrl-mcp23s08_i2c.c
pinctrl-mcp23s08_spi.c
pinctrl-microchip-sgpio.c
pinctrl-mlxbf3.c
pinctrl-ocelot.c pinctrl: ocelot: fix system hang on level based interrupts 2024-10-12 22:04:38 +02:00
pinctrl-palmas.c
pinctrl-pef2256.c
pinctrl-pic32.c
pinctrl-pic32.h
pinctrl-pistachio.c
pinctrl-rk805.c
pinctrl-rockchip.c
pinctrl-rockchip.h
pinctrl-scmi.c
pinctrl-single.c
pinctrl-st.c
pinctrl-stmfx.c
pinctrl-sx150x.c
pinctrl-tb10x.c
pinctrl-tps6594.c
pinctrl-utils.c
pinctrl-utils.h
pinctrl-xway.c
pinctrl-zynq.c
pinctrl-zynqmp.c
pinmux.c
pinmux.h