linux-stable/drivers/pinctrl
Alexis Lothoré 14694179e5 pinctrl: at91-pio4: use dedicated lock class for IRQ
Trying to suspend to RAM on SAMA5D27 EVK leads to the following lockdep
warning:

 ============================================
 WARNING: possible recursive locking detected
 6.7.0-rc5-wt+ #532 Not tainted
 --------------------------------------------
 sh/92 is trying to acquire lock:
 c3cf306c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 but task is already holding lock:
 c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&irq_desc_lock_class);
   lock(&irq_desc_lock_class);

  *** DEADLOCK ***

  May be due to missing lock nesting notation

 6 locks held by sh/92:
  #0: c3aa0258 (sb_writers#6){.+.+}-{0:0}, at: ksys_write+0xd8/0x178
  #1: c4c2df44 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x138/0x284
  #2: c32684a0 (kn->active){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x148/0x284
  #3: c232b6d4 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend+0x13c/0x4e8
  #4: c387b088 (&dev->mutex){....}-{3:3}, at: __device_suspend+0x1e8/0x91c
  #5: c3d7c46c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0xe8/0x100

 stack backtrace:
 CPU: 0 PID: 92 Comm: sh Not tainted 6.7.0-rc5-wt+ #532
 Hardware name: Atmel SAMA5
  unwind_backtrace from show_stack+0x18/0x1c
  show_stack from dump_stack_lvl+0x34/0x48
  dump_stack_lvl from __lock_acquire+0x19ec/0x3a0c
  __lock_acquire from lock_acquire.part.0+0x124/0x2d0
  lock_acquire.part.0 from _raw_spin_lock_irqsave+0x5c/0x78
  _raw_spin_lock_irqsave from __irq_get_desc_lock+0xe8/0x100
  __irq_get_desc_lock from irq_set_irq_wake+0xa8/0x204
  irq_set_irq_wake from atmel_gpio_irq_set_wake+0x58/0xb4
  atmel_gpio_irq_set_wake from irq_set_irq_wake+0x100/0x204
  irq_set_irq_wake from gpio_keys_suspend+0xec/0x2b8
  gpio_keys_suspend from dpm_run_callback+0xe4/0x248
  dpm_run_callback from __device_suspend+0x234/0x91c
  __device_suspend from dpm_suspend+0x224/0x43c
  dpm_suspend from dpm_suspend_start+0x9c/0xa8
  dpm_suspend_start from suspend_devices_and_enter+0x1e0/0xa84
  suspend_devices_and_enter from pm_suspend+0x460/0x4e8
  pm_suspend from state_store+0x78/0xe4
  state_store from kernfs_fop_write_iter+0x1a0/0x284
  kernfs_fop_write_iter from vfs_write+0x38c/0x6f4
  vfs_write from ksys_write+0xd8/0x178
  ksys_write from ret_fast_syscall+0x0/0x1c
 Exception stack(0xc52b3fa8 to 0xc52b3ff0)
 3fa0:                   00000004 005a0ae8 00000001 005a0ae8 00000004 00000001
 3fc0: 00000004 005a0ae8 00000001 00000004 00000004 b6c616c0 00000020 0059d190
 3fe0: 00000004 b6c61678 aec5a041 aebf1a26

This warning is raised because pinctrl-at91-pio4 uses chained IRQ. Whenever
a wake up source configures an IRQ through irq_set_irq_wake, it will
lock the corresponding IRQ desc, and then call irq_set_irq_wake on "parent"
IRQ which will do the same on its own IRQ desc, but since those two locks
share the same class, lockdep reports this as an issue.

Fix lockdep false positive by setting a different class for parent and
children IRQ

Fixes: 776180848b ("pinctrl: introduce driver for Atmel PIO4 controller")
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Link: https://lore.kernel.org/r/20231215-lockdep_warning-v1-1-8137b2510ed5@bootlin.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-12-21 09:05:02 +01:00
..
actions pinctrl: actions: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:50 -07:00
aspeed pinctrl: aspeed: Allow changing SPI mode from hardware strap defaults 2023-10-10 14:01:30 +02:00
bcm treewide: rename pinctrl_gpio_free_new() 2023-11-04 10:23:21 +01:00
berlin pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
cirrus pinctrl: lochnagar: Don't build on MIPS 2023-11-16 14:40:38 +01:00
freescale pinctrl: mxs: Remove undocumented 'fsl,mxs-gpio' property 2023-10-10 13:41:37 +02:00
intel treewide: rename pinctrl_gpio_direction_output_new() 2023-11-04 10:23:22 +01:00
mediatek pinctrl: mediatek: common: drop the wrappers around pinctrl_gpio_direction_input() 2023-11-04 10:23:23 +01:00
meson pinctrl: Add driver support for Amlogic T7 SoCs 2023-09-25 15:49:18 +02:00
mvebu pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
nomadik pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
nuvoton pinctrl: nuvoton: npcm8xx: drop wrappers around pinctrl_gpio_request/free() 2023-11-04 10:23:23 +01:00
nxp pinctrl: s32cc: Avoid possible string truncation 2023-11-14 14:43:37 +01:00
pxa pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
qcom Pin control changes for the v6.7 kernel cycle 2023-11-03 19:15:19 -10:00
realtek pinctrl: realtek: Fix logical error when finding descriptor 2023-11-24 10:39:20 +01:00
renesas treewide: rename pinctrl_gpio_direction_output_new() 2023-11-04 10:23:22 +01:00
samsung pinctrl: samsung: do not offset pinctrl numberspaces 2023-10-09 12:37:21 +02:00
spear treewide: rename pinctrl_gpio_free_new() 2023-11-04 10:23:21 +01:00
sprd pinctrl: sprd-sc9860: Convert to platform remove callback returning void 2023-10-10 15:47:50 +02:00
starfive pinctrl: starfive: jh7100: ignore disabled device tree nodes 2023-12-04 11:13:01 +01:00
stm32 pinctrl: stm32: fix array read out of bound 2023-11-14 14:41:48 +01:00
sunplus pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
sunxi pinctrl: sunxi: h616: add extra gpio banks 2023-09-25 15:26:33 +02:00
tegra Pin control changes for the v6.7 kernel cycle 2023-11-03 19:15:19 -10:00
ti pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
uniphier pinctrl: uniphier: Annotate struct uniphier_pinctrl_reg_region with __counted_by 2023-09-27 10:59:06 +02:00
visconti
vt8500 pinctrl: vt8500: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
core.c pinctrl: avoid reload of p state in list iteration 2023-11-15 11:40:15 +01:00
core.h pinctrl: Move for_each_maps() to namespace and hide iterator inside 2022-11-14 14:19:33 +01:00
devicetree.c pinctrl: devicetree: fix null pointer dereferencing in pinctrl_dt_to_map 2022-11-10 12:26:18 +01:00
devicetree.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
Kconfig pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs 2023-09-20 13:07:18 +02:00
Makefile pinctrl: realtek: Add common pinctrl driver for Realtek DHC RTD SoCs 2023-09-20 13:07:18 +02:00
pinconf-generic.c pinctrl: Replace kernel.h by what is actually being used 2023-10-03 16:29:30 +03:00
pinconf.c pinctrl: Replace kernel.h by what is actually being used 2023-10-03 16:29:30 +03:00
pinconf.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
pinctrl-amd.c pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend 2023-12-04 15:46:02 +01:00
pinctrl-amd.h pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend 2023-12-04 15:46:02 +01:00
pinctrl-apple-gpio.c
pinctrl-artpec6.c pinctrl: artpec6: Convert to platform remove callback returning void 2023-10-10 15:39:10 +02:00
pinctrl-as3722.c pinctrl: as3722: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: use dedicated lock class for IRQ 2023-12-21 09:05:02 +01:00
pinctrl-at91.c pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
pinctrl-at91.h
pinctrl-axp209.c pinctrl: axp209: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-bm1880.c
pinctrl-cy8c95x0.c pinctrl: cy8c95x0: Fix get_pincfg 2023-12-20 13:02:18 +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 pinctrl: da9062: don't include private GPIOLIB header 2023-09-12 10:06:01 +02:00
pinctrl-digicolor.c pinctrl: digicolor: Use proper headers and drop OF dependency 2023-01-16 15:14:03 +01:00
pinctrl-equilibrium.c pinctrl: equilibrium: Convert to immutable irq_chip 2023-04-14 11:08:17 +02:00
pinctrl-equilibrium.h pinctrl: equilibrium: Convert to immutable irq_chip 2023-04-14 11:08:17 +02:00
pinctrl-falcon.c pinctrl: lantiq: Remove unused of_gpio.h inclusion 2023-06-16 15:04:34 +02:00
pinctrl-gemini.c
pinctrl-ingenic.c pinctrl: ingenic: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-k210.c pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
pinctrl-keembay.c
pinctrl-lantiq.c
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 some const correctness 2022-11-25 11:41:01 +01:00
pinctrl-lpc18xx.c pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
pinctrl-max77620.c
pinctrl-mcp23s08.c pinctrl: mcp23s08: Convert to immutable irq_chip 2023-04-14 11:08:17 +02:00
pinctrl-mcp23s08.h pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-mcp23s08_i2c.c pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-mcp23s08_spi.c pinctrl: mcp23s08: Simplify probe()/mcp23s08_spi_regmap_init() 2023-10-10 13:39:38 +02:00
pinctrl-microchip-sgpio.c pinctrl: microchip-sgpio: check return value of devm_kasprintf() 2023-06-16 15:01:45 +02:00
pinctrl-mlxbf3.c pinctrl: mlxbf3: Remove gpio_disable_free() 2023-08-25 15:44:15 +02:00
pinctrl-ocelot.c pinctrl: ocelot: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:23 +01:00
pinctrl-palmas.c pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
pinctrl-pic32.c pinctrl: Explicitly include correct DT includes 2023-07-20 21:41:24 +02:00
pinctrl-pic32.h
pinctrl-pistachio.c pinctrl: pistachio: Convert to immutable irq_chip 2023-04-20 16:07:40 +02:00
pinctrl-rk805.c pinctrl: rk805: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:23 +01:00
pinctrl-rockchip.c pinctrl: rockchip: Convert to platform remove callback returning void 2023-10-10 15:40:22 +02:00
pinctrl-rockchip.h
pinctrl-single.c pinctrl: single: Convert to platform remove callback returning void 2023-10-10 15:40:54 +02:00
pinctrl-st.c pinctrl: st: drop the wrapper around pinctrl_gpio_direction_input() 2023-11-04 10:23:22 +01:00
pinctrl-stmfx.c pinctrl: stmfx: Convert to platform remove callback returning void 2023-10-10 15:41:35 +02:00
pinctrl-sx150x.c pinctrl: sx150x: Simplify probe() 2023-09-12 10:12:36 +02:00
pinctrl-tb10x.c pinctrl: tb10x: Convert to platform remove callback returning void 2023-10-10 15:42:07 +02:00
pinctrl-utils.c pinctrl: Replace kernel.h by what is actually being used 2023-10-03 16:29:30 +03:00
pinctrl-utils.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00
pinctrl-xway.c pinctrl: Use device_get_match_data() 2023-10-30 14:50:42 +01:00
pinctrl-zynq.c
pinctrl-zynqmp.c pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high impedance 2023-08-07 10:48:03 +02:00
pinmux.c intel-pinctrl for v6.7-1 2023-10-16 22:00:13 +02:00
pinmux.h pinctrl: Clean up headers 2022-10-24 17:06:48 +03:00