linux/drivers/pinctrl
Francesco Lavra db5b8cecbd pinctrl: mcp23s08: Disable all pin interrupts during probe
A chip being probed may have the interrupt-on-change feature enabled on
some of its pins, for example after a reboot. This can cause the chip to
generate interrupts for pins that don't have a registered nested handler,
which leads to a kernel crash such as below:

[    7.928897] Unable to handle kernel read from unreadable memory at virtual address 00000000000000ac
[    7.932314] Mem abort info:
[    7.935081]   ESR = 0x0000000096000004
[    7.938808]   EC = 0x25: DABT (current EL), IL = 32 bits
[    7.944094]   SET = 0, FnV = 0
[    7.947127]   EA = 0, S1PTW = 0
[    7.950247]   FSC = 0x04: level 0 translation fault
[    7.955101] Data abort info:
[    7.957961]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[    7.963421]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[    7.968447]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[    7.973734] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000089b7000
[    7.980148] [00000000000000ac] pgd=0000000000000000, p4d=0000000000000000
[    7.986913] Internal error: Oops: 0000000096000004 [#1]  SMP
[    7.992545] Modules linked in:
[    8.073678] CPU: 0 UID: 0 PID: 81 Comm: irq/18-4-0025 Not tainted 7.0.0-rc6-gd2b5a1f931c8-dirty #199
[    8.073689] Hardware name: Khadas VIM3 (DT)
[    8.073692] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    8.094639] pc : _raw_spin_lock_irq+0x40/0x80
[    8.098970] lr : handle_nested_irq+0x2c/0x168
[    8.098979] sp : ffff800082b2bd20
[    8.106599] x29: ffff800082b2bd20 x28: ffff800080107920 x27: ffff800080104d88
[    8.106611] x26: ffff000003298080 x25: 0000000000000001 x24: 000000000000ff00
[    8.113707] x23: 0000000000000001 x22: 0000000000000000 x21: 000000000000000e
[    8.120850] x20: 0000000000000000 x19: 00000000000000ac x18: 0000000000000000
[    8.135046] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[    8.135062] x14: ffff800081567ea8 x13: ffffffffffffffff x12: 0000000000000000
[    8.135070] x11: 00000000000000c0 x10: 0000000000000b60 x9 : ffff800080109e0c
[    8.135078] x8 : 1fffe0000069dbc1 x7 : 0000000000000001 x6 : ffff0000034ede00
[    8.135086] x5 : 0000000000000000 x4 : ffff0000034ede08 x3 : 0000000000000001
[    8.163460] x2 : 0000000000000000 x1 : 0000000000000001 x0 : 00000000000000ac
[    8.170560] Call trace:
[    8.180094]  _raw_spin_lock_irq+0x40/0x80 (P)
[    8.184443]  mcp23s08_irq+0x248/0x358
[    8.184462]  irq_thread_fn+0x34/0xb8
[    8.184470]  irq_thread+0x1a4/0x310
[    8.195093]  kthread+0x13c/0x150
[    8.198309]  ret_from_fork+0x10/0x20
[    8.201850] Code: d65f03c0 d2800002 52800023 f9800011 (885ffc01)
[    8.207931] ---[ end trace 0000000000000000 ]---

This issue has always been present, but has been latent until commit
"f9f4fda15e72" ("pinctrl: mcp23s08: init reg_defaults from HW at probe and
switch cache type"), which correctly removed reg_defaults from the regmap
and as a side effect changed the behavior of the interrupt handler so that
the real value of the MCP_GPINTEN register is now being read from the chip
instead of using a bogus 0 default value; a non-zero value for this
register can trigger the invocation of a nested handler which may not exist
(yet).
Fix this issue by disabling all pin interrupts during initialization.

Fixes: f9f4fda15e ("pinctrl: mcp23s08: init reg_defaults from HW at probe and switch cache type")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
2026-04-07 11:29:57 +02:00
..
actions treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
aspeed pinctrl: aspeed: Cleanup header includes 2026-01-19 01:11:46 +01:00
bcm Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
berlin Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
cirrus pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() 2026-02-24 10:51:30 +01:00
cix pinctrl: cix: sky1: Unexport sky1_pinctrl_pm_ops 2026-02-24 10:51:29 +01:00
freescale Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
intel pinctrl: intel: Enable 3-bit PAD_OWN feature 2026-03-19 07:58:53 +01:00
mediatek pinctrl: mediatek: common: Fix probe failure for devices without EINT 2026-03-19 19:52:22 +01:00
meson pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux() 2026-02-24 10:51:30 +01:00
microchip Pin control changes for the v7.0 kernel cycle: 2026-02-16 09:35:24 -08:00
mvebu Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nomadik Pin control changes for the v6.18 kernel cycle: 2025-10-01 13:14:48 -07:00
nuvoton Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
nxp Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pxa pinctrl: pxa2xx: use devm_kmemdup_array() 2025-02-24 12:08:52 +02:00
qcom pinctrl: qcom: spmi-gpio: implement .get_direction() 2026-03-10 10:21:52 +01:00
realtek pinctrl: realtek: Select REGMAP_MMIO for RTD driver 2025-10-23 15:09:01 +02:00
renesas pinctrl: renesas: rza1: Normalize return value of gpio_get() 2026-03-10 10:33:47 +01:00
samsung pinctrl: samsung: Add Exynos9610 pinctrl configuration 2026-01-11 12:10:29 +01:00
sophgo Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
spacemit Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
spear Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sprd pinctrl: Simplify printks with pOF format 2025-09-12 14:19:31 +02:00
starfive Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
stm32 pinctrl: stm32: fix HDP driver dependency on GPIO_GENERIC 2026-03-19 16:44:45 +01:00
sunplus Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sunxi pinctrl: sunxi: fix gpiochip_lock_as_irq() failure when pinmux is unknown 2026-03-23 14:23:09 +01:00
tegra pinctrl: tegra-xusb: Simplify locking with guard() 2026-01-19 01:11:47 +01:00
ti pinctrl: ti: ti-iodelay: Constify struct ti_iodelay_reg_data 2024-08-05 09:22:33 +02:00
uniphier pinctrl: uniphier: Do not enable by default during compile testing 2025-04-15 10:08:42 +02:00
visconti
vt8500 Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
core.h pinctrl: Constify pointers to 'pinctrl_desc' 2025-06-18 13:26:36 +02:00
devicetree.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
devicetree.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
Kconfig pinctrl: fix kismet issues with GENERIC_PINCTRL 2026-02-03 00:56:53 +01:00
Makefile pinctrl: add generic functions + pins mapper 2026-01-21 13:13:37 +01:00
pinconf-generic.c pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config() 2026-02-24 10:51:29 +01:00
pinconf.c pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinconf.h pinctrl: add generic functions + pins mapper 2026-01-21 13:13:37 +01:00
pinctrl-amd.c pinctrl: amd: Cleanup header includes 2026-01-19 01:11:46 +01:00
pinctrl-amd.h pinctrl: amd: Take suspend type into consideration which pins are non-wake 2025-01-14 14:33:59 +01:00
pinctrl-amdisp.c pinctrl: amdisp: Make amdisp_pinctrl_ops variable static 2026-02-24 10:51:29 +01:00
pinctrl-amdisp.h pinctrl: amd: isp411: Add amdisp GPIO pinctrl 2025-03-05 08:47:43 +01:00
pinctrl-apple-gpio.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
pinctrl-artpec6.c pinctrl: Constify static 'pinctrl_desc' 2025-06-18 13:26:37 +02:00
pinctrl-as3722.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: Add sama7d65 pio4 support 2026-01-07 15:22:14 +01:00
pinctrl-at91.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-at91.h
pinctrl-aw9523.c pinctrl: aw9523: Simplify locking with guard() 2026-01-19 01:11:46 +01:00
pinctrl-axp209.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-bm1880.c pinctrl: Constify static 'pinctrl_desc' 2025-06-18 13:26:37 +02:00
pinctrl-cy8c95x0.c pinctrl: cy8c95x0: Don't miss reading the last bank registers 2026-02-26 23:41:04 +01:00
pinctrl-da850-pupd.c pinctrl: da850-pupd: Drop empty platform remove function 2022-12-29 02:02:46 +01:00
pinctrl-da9062.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-digicolor.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-eic7700.c pinctrl: eswin: Fix regulator error check and Kconfig dependency 2025-09-08 14:23:51 +02:00
pinctrl-ep93xx.c pinctrl: ep93xx: Fix raster pins typo 2024-09-16 11:16:15 +00:00
pinctrl-equilibrium.c pinctrl: equilibrium: fix warning trace on load 2026-02-23 10:28:04 +01:00
pinctrl-equilibrium.h pinctrl: equilibrium: use new generic GPIO chip API 2025-08-19 11:41:38 +02:00
pinctrl-eyeq5.c pinctrl: eyeq5: add platform driver 2024-08-04 00:51:28 +02:00
pinctrl-falcon.c pinctrl: falcon: mark pinctrl_falcon_init() as static 2025-06-24 21:01:31 +02:00
pinctrl-gemini.c pinctrl: Use str_enable_disable-like helpers 2025-01-15 12:52:26 +01:00
pinctrl-generic.c pinctrl: add generic functions + pins mapper 2026-01-21 13:13:37 +01:00
pinctrl-ingenic.c pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL 2025-09-08 14:24:20 +02:00
pinctrl-k210.c pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL 2025-09-08 14:24:20 +02:00
pinctrl-k230.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pinctrl-keembay.c pinctrl: keembay: fix double free in keembay_build_functions() 2025-09-08 14:24:12 +02:00
pinctrl-lantiq.c pinctrl: lantiq: Add missing header(s) 2022-10-24 17:06:46 +03:00
pinctrl-lantiq.h pinctrl: lantiq: Remove unsued declaration ltq_pinctrl_unregister() 2023-09-11 15:42:12 +02:00
pinctrl-loongson2.c pinctrl: loongson2: fix module autoloading 2024-04-17 10:43:50 +02:00
pinctrl-lpc18xx.c pinctrl: Constify static 'pinctrl_desc' 2025-06-18 13:26:37 +02:00
pinctrl-max7360.c pinctrl: Add MAX7360 pinctrl driver 2025-09-16 15:24:48 +01:00
pinctrl-max77620.c pinctrl: max77620: Move fixed assignments to 'pinctrl_desc' definition 2025-06-18 13:26:37 +02:00
pinctrl-mcp23s08_i2c.c pinctrl: add missing MODULE_DESCRIPTION() macros 2024-06-17 10:59:31 +02:00
pinctrl-mcp23s08_spi.c pinctrl: add missing MODULE_DESCRIPTION() macros 2024-06-17 10:59:31 +02:00
pinctrl-mcp23s08.c pinctrl: mcp23s08: Disable all pin interrupts during probe 2026-04-07 11:29:57 +02:00
pinctrl-mcp23s08.h pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-microchip-sgpio.c pinctrl: microchip-sgpio: Simplify locking with guard() 2026-01-19 01:11:47 +01:00
pinctrl-mlxbf3.c pinctrl: Constify static 'pinctrl_desc' 2025-06-18 13:26:37 +02:00
pinctrl-ocelot.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
pinctrl-palmas.c pinctrl: palmas: Move fixed assignments to 'pinctrl_desc' definition 2025-06-18 13:26:37 +02:00
pinctrl-pef2256.c pinctrl: Add support for the Lantic PEF2256 pinmux 2023-12-12 23:05:24 +01:00
pinctrl-pic32.c pinctrl: pic32: update include to use pic32.h from platform_data 2026-01-30 15:29:08 +01:00
pinctrl-pic32.h
pinctrl-pistachio.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-rk805.c pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL 2025-09-08 14:24:20 +02:00
pinctrl-rockchip.c pinctrl: rockchip: Fix configuring a deferred pin 2026-02-24 10:51:30 +01:00
pinctrl-rockchip.h pinctrl: rockchip: Add rk3506 pinctrl support 2025-11-10 23:24:06 +01:00
pinctrl-rp1.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pinctrl-scmi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pinctrl-single.c pinctrl: single: fix refcount leak in pcs_add_gpio_func() 2026-02-03 01:30:59 +01:00
pinctrl-st.c pinctrl: st: Annotate st_pinconf_dbg_show() as holding mutex 2026-01-19 01:11:47 +01:00
pinctrl-stmfx.c pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL 2025-09-08 14:24:20 +02:00
pinctrl-sx150x.c pinctrl: generic: rename PIN_CONFIG_OUTPUT to LEVEL 2025-09-08 14:24:20 +02:00
pinctrl-tb10x.c pinctrl: tb10x: Simplify locking with guard() 2026-01-19 01:11:47 +01:00
pinctrl-th1520.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pinctrl-tps6594.c pinctrl: pinctrl-tps6594: Add TPS652G1 PMIC pinctrl and GPIO 2025-07-10 09:58:12 +01:00
pinctrl-upboard.c pinctrl: Add pin controller driver for AAEON UP boards 2025-08-18 17:45:07 +02:00
pinctrl-utils.c drivers/pinctrl: Switch to use kmemdup_array() 2024-08-26 10:27:52 +02:00
pinctrl-utils.h pinctrl: Convert unsigned to unsigned int 2023-12-04 15:32:42 +01:00
pinctrl-xway.c treewide: rename GPIO set callbacks back to their original names 2025-08-07 10:07:06 +02:00
pinctrl-zynq.c pinctrl: Constify static 'pinctrl_desc' 2025-06-18 13:26:37 +02:00
pinctrl-zynqmp.c arm64: Xilinx SOC changes for 6.18 2025-10-17 15:24:00 +02:00
pinmux.c pinctrl: allow to mark pin functions as requestable GPIOs 2025-09-08 14:22:58 +02:00
pinmux.h pinctrl: allow to mark pin functions as requestable GPIOs 2025-09-08 14:22:58 +02:00