Stephen Boyd
13d368cd1e
gpiolib: Set lockdep class for hierarchical irq domains
...
[ Upstream commit c34f6dc8c9e6bbe9fba1d53acd6d9a3889599da3 ]
I see the following lockdep splat in the qcom pinctrl driver when
attempting to suspend the device.
============================================
WARNING: possible recursive locking detected
5.4.2 #2 Tainted: G S
--------------------------------------------
cat/6536 is trying to acquire lock:
ffffff814787ccc0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
but task is already holding lock:
ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
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
7 locks held by cat/6536:
#0 : ffffff8140e0c420 (sb_writers#7){.+.+}, at: vfs_write+0xc8/0x19c
#1 : ffffff8121eec480 (&of->mutex){+.+.}, at: kernfs_fop_write+0x128/0x1f4
#2 : ffffff8147cad668 (kn->count#263){.+.+}, at: kernfs_fop_write+0x130/0x1f4
#3 : ffffffd011446000 (system_transition_mutex){+.+.}, at: pm_suspend+0x108/0x354
#4 : ffffff814302b970 (&dev->mutex){....}, at: __device_suspend+0x16c/0x420
#5 : ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
#6 : ffffff81479b8c10 (&pctrl->lock){....}, at: msm_gpio_irq_set_wake+0x48/0x7c
stack backtrace:
CPU: 4 PID: 6536 Comm: cat Tainted: G S 5.4.2 #2
Call trace:
dump_backtrace+0x0/0x174
show_stack+0x20/0x2c
dump_stack+0xdc/0x144
__lock_acquire+0x52c/0x2268
lock_acquire+0x1dc/0x220
_raw_spin_lock_irqsave+0x64/0x80
__irq_get_desc_lock+0x64/0x94
irq_set_irq_wake+0x40/0x144
msm_gpio_irq_set_wake+0x5c/0x7c
set_irq_wake_real+0x40/0x5c
irq_set_irq_wake+0x70/0x144
cros_ec_rtc_suspend+0x38/0x4c
platform_pm_suspend+0x34/0x60
dpm_run_callback+0x64/0xcc
__device_suspend+0x314/0x420
dpm_suspend+0xf8/0x298
dpm_suspend_start+0x84/0xb4
suspend_devices_and_enter+0xbc/0x628
pm_suspend+0x214/0x354
state_store+0xb0/0x108
kobj_attr_store+0x14/0x24
sysfs_kf_write+0x4c/0x64
kernfs_fop_write+0x158/0x1f4
__vfs_write+0x54/0x18c
vfs_write+0xdc/0x19c
ksys_write+0x7c/0xe4
__arm64_sys_write+0x20/0x2c
el0_svc_common+0xa8/0x160
el0_svc_compat_handler+0x2c/0x38
el0_svc_compat+0x8/0x10
This is because the msm_gpio_irq_set_wake() function calls
irq_set_irq_wake() as a backup in case the irq comes in during the path
to idle. Given that we're calling irqchip functions from within an
irqchip we need to set the lockdep class to be different for this child
controller vs. the default one that the parent irqchip gets.
This used to be done before this driver was converted to hierarchical
irq domains in commit e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in
hierarchy") via the gpiochip_irq_map() function. With hierarchical irq
domains this function has been replaced by
gpiochip_hierarchy_irq_domain_alloc(). Therefore, set the lockdep class
like was done previously in the irq domain path so we can avoid this
lockdep warning.
Fixes: fdd61a013a ("gpio: Add support for hierarchical IRQ domains")
Cc: Thierry Reding <treding@nvidia.com>
Cc: Brian Masney <masneyb@onstation.org>
Cc: Lina Iyer <ilina@codeaurora.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20200114231103.85641-1-swboyd@chromium.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-02-24 08:36:49 +01:00
..
gpio-74x164.c
gpio: 74x164: Convert to use SPDX identifier
2019-03-26 18:38:07 +01:00
gpio-74xx-mmio.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-104-dio-48e.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-104-idi-48.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-104-idio-16.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-adnp.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-adp5520.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149
2019-05-30 11:25:18 -07:00
gpio-adp5588.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149
2019-05-30 11:25:18 -07:00
gpio-altera-a10sr.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201
2019-05-30 11:29:52 -07:00
gpio-altera.c
gpio: altera: Pass irqchip when adding gpiochip
2019-07-03 10:24:12 +02:00
gpio-amd-fch.c
drivers: gpio: amd-fch: make resource struct const
2019-07-03 10:10:32 +02:00
gpio-amd8111.c
gpio-amdpt.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-arizona.c
gpio: arizona: Use local copy of pdata
2019-08-05 11:42:29 +02:00
gpio-aspeed.c
gpio: aspeed: Add in ast2600 details to Aspeed driver
2019-09-11 11:13:11 +01:00
gpio-ath79.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-bcm-kona.c
drivers: gpio: bcm-kona: use devm_platform_ioremap_resource()
2019-04-05 00:04:25 +07:00
gpio-bd9571mwv.c
gpio-bd70528.c
gpio: bd70528: Use correct unit for debounce times
2019-11-12 11:18:52 +01:00
gpio-brcmstb.c
gpio: Remove dev_err() usage after platform_get_irq()
2019-08-05 13:25:34 +02:00
gpio-bt8xx.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
2019-05-24 17:36:45 +02:00
gpio-cadence.c
gpio: cadence: Pass irqchip when adding gpiochip
2019-08-15 09:44:19 +02:00
gpio-clps711x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-creg-snps.c
gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code
2019-09-11 14:50:02 +01:00
gpio-crystalcove.c
gpio-cs5535.c
docs: driver-model: move it to the driver-api book
2019-07-15 11:03:02 -03:00
gpio-da9052.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-da9055.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-davinci.c
gpio: davinci: silence error prints in case of EPROBE_DEFER
2019-07-15 11:52:34 +02:00
gpio-dln2.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372
2019-06-05 17:37:10 +02:00
gpio-dwapb.c
gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h
2019-07-31 00:57:21 +02:00
gpio-eic-sprd.c
gpio: eic: sprd: Fix the incorrect EIC offset when toggling
2019-10-01 11:50:40 +02:00
gpio-em.c
gpio: em: use a helper variable for &pdev->dev
2019-07-22 14:40:07 +02:00
gpio-ep93xx.c
gpio: ep93xx: Pass irqchip when adding gpiochip
2019-09-04 10:59:10 +02:00
gpio-exar.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-f7188x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-ftgpio010.c
gpio: ftgpio: Fix an error handling path in 'ftgpio_gpio_probe()'
2019-08-23 12:02:34 +02:00
gpio-ge.c
gpio-gpio-mm.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-grgpio.c
gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap()
2020-02-24 08:36:26 +01:00
gpio-gw-pld.c
gpio-hlwd.c
gpio: hlwd: Pass irqchip when adding gpiochip
2019-08-15 09:57:29 +02:00
gpio-htc-egpio.c
gpio: htc-egpio: Remove unused exported htc_egpio_get_wakeup_irq()
2019-09-12 10:07:44 +01:00
gpio-ich.c
gpio-intel-mid.c
gpio: intel-mid: Move hardware initialization to callback
2019-10-15 01:18:51 +02:00
gpio-iop.c
Merge branch 'i2c/for-5.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
2019-07-15 21:10:39 -07:00
gpio-it87.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 300
2019-06-05 17:37:00 +02:00
gpio-ixp4xx.c
gpio: updates for v5.4
2019-09-03 16:04:19 +02:00
gpio-janz-ttl.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-kempld.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 294
2019-06-05 17:36:38 +02:00
gpio-loongson.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-loongson1.c
drivers: gpio: loongon1: use devm_platform_ioremap_resource()
2019-04-05 00:04:26 +07:00
gpio-lp873x.c
gpio-lp3943.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372
2019-06-05 17:37:10 +02:00
gpio-lp87565.c
gpio-lpc18xx.c
drivers: gpio: lpc18xx: use devm_platform_ioremap_resource()
2019-04-05 00:04:26 +07:00
gpio-lpc32xx.c
gpio: lpc32xx: allow building on non-lpc32xx targets
2019-08-15 21:33:07 +02:00
gpio-lynxpoint.c
gpio: lynxpoint: Setup correct IRQ handlers
2020-01-04 19:18:20 +01:00
gpio-madera.c
gpio: madera: Add support for Cirrus Logic CS47L92
2019-08-05 11:45:24 +02:00
gpio-max730x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-max732x.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-max3191x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-max7300.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-max7301.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-max77620.c
gpio: max77620: Fixup debounce delays
2019-11-12 11:13:54 +01:00
gpio-max77650.c
gpio: max77650: add MODULE_ALIAS()
2019-07-29 00:03:52 +02:00
gpio-mb86s7x.c
gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h
2019-07-31 00:57:21 +02:00
gpio-mc9s08dz60.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
2019-05-30 11:26:37 -07:00
gpio-mc33880.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176
2019-05-30 11:29:19 -07:00
gpio-menz127.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441
2019-06-05 17:37:17 +02:00
gpio-merrifield.c
Revert "gpio: merrifield: Pass irqchip when adding gpiochip"
2019-11-03 23:41:11 +01:00
gpio-ml-ioh.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 167
2019-05-30 11:26:39 -07:00
gpio-mlxbf.c
gpio: mlxbf: remove unused including <linux/version.h>
2019-04-08 08:47:06 +02:00
gpio-mm-lantiq.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-mmio.c
gpio: mmio: Drop bgpio_dir_inverted
2019-04-08 11:17:43 +02:00
gpio-mockup.c
gpio: mockup: add missing single_release()
2019-09-09 09:55:27 +02:00
gpio-moxtet.c
drivers: gpio: Add support for GPIOs over Moxtet bus
2019-08-14 15:30:56 +02:00
gpio-mpc8xxx.c
gpio: mpc8xxx: Add platform device to gpiochip->parent
2020-01-17 19:49:03 +01:00
gpio-mpc5200.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333
2019-06-05 17:37:06 +02:00
gpio-msic.c
gpio-mt7621.c
gpio: mt7621: Pass irqchip when adding gpiochip
2019-08-23 12:05:06 +02:00
gpio-mvebu.c
pwm: Ensure pwm_apply_state() doesn't modify the state argument
2019-09-21 03:25:10 +02:00
gpio-mxc.c
gpio: mxc: Only get the second IRQ when there is more than one IRQ
2020-01-04 19:16:27 +01:00
gpio-mxs.c
gpio-octeon.c
drivers: gpio: octeon: use devm_platform_ioremap_resource()
2019-04-05 00:04:27 +07:00
gpio-omap.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-palmas.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201
2019-05-30 11:29:52 -07:00
gpio-pca953x.c
This is the bulk of changes in the GPIO subsystem for the
2019-09-16 14:06:50 -07:00
gpio-pcf857x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
2019-05-24 17:36:45 +02:00
gpio-pch.c
gpio: pch: Use dev_get_drvdata
2019-07-23 18:59:05 +03:00
gpio-pci-idio-16.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-pcie-idio-24.c
gpio-pisosr.c
gpio-pl061.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-pmic-eic-sprd.c
gpio: Remove dev_err() usage after platform_get_irq()
2019-08-05 13:25:34 +02:00
gpio-pxa.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-raspberrypi-exp.c
gpio-rc5t583.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201
2019-05-30 11:29:52 -07:00
gpio-rcar.c
gpio: rcar: Pedantic formatting
2019-06-27 15:56:50 +01:00
gpio-rdc321x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61
2019-05-24 17:36:45 +02:00
gpio-reg.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 233
2019-06-19 17:09:06 +02:00
gpio-sa1100.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-sama5d2-piobu.c
gpio-sch.c
gpio: sch: Remove write-only core_base
2019-04-23 13:08:33 +02:00
gpio-sch311x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-siox.c
gpio: siox: Use devm_ managed gpiochip
2019-07-03 10:24:02 +02:00
gpio-sodaville.c
gpio-spear-spics.c
drivers: gpio: spear-spics: use devm_platform_ioremap_resource()
2019-04-05 00:04:27 +07:00
gpio-sprd.c
gpio: Remove dev_err() usage after platform_get_irq()
2019-08-05 13:25:34 +02:00
gpio-sta2x11.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333
2019-06-05 17:37:06 +02:00
gpio-stmpe.c
gpio: Initialize the irqchip valid_mask with a callback
2019-09-11 01:09:37 +01:00
gpio-stp-xway.c
Bulk GPIO changes for the v5.3 kernel cycle:
2019-07-09 09:07:00 -07:00
gpio-syscon.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152
2019-05-30 11:26:32 -07:00
gpio-tb10x.c
gpio: Remove dev_err() usage after platform_get_irq()
2019-08-05 13:25:34 +02:00
gpio-tc3589x.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 464
2019-06-19 17:09:10 +02:00
gpio-tegra.c
gpio: Remove dev_err() usage after platform_get_irq()
2019-08-05 13:25:34 +02:00
gpio-tegra186.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 233
2019-06-19 17:09:06 +02:00
gpio-thunderx.c
Revert "gpio: thunderx: Switch to GPIOLIB_IRQCHIP"
2020-01-23 08:22:29 +01:00
gpio-timberdale.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 176
2019-05-30 11:29:19 -07:00
gpio-tpic2810.c
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 111
2019-05-24 17:39:01 +02:00
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c
gpio-tqmx86.c
gpio: Initialize the irqchip valid_mask with a callback
2019-09-11 01:09:37 +01:00
gpio-ts4800.c
drivers: gpio: ts4800: use devm_platform_ioremap_resource()
2019-04-05 00:04:28 +07:00
gpio-ts4900.c
gpio-ts5500.c
gpio-twl4030.c
gpio-twl6040.c
gpio-ucb1400.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-uniphier.c
drivers: gpio: uniphier: use devm_platform_ioremap_resource()
2019-04-05 00:04:28 +07:00
gpio-vf610.c
gpio: vf610: Pass irqchip when adding gpiochip
2019-08-23 09:41:18 +02:00
gpio-viperboard.c
gpio: viperboard: Replace 'unsigned' with 'unsigned int'
2019-08-05 11:26:58 +02:00
gpio-vr41xx.c
gpio: vr41xx: Use devm_platform_ioremap_resource()
2019-06-27 15:56:51 +01:00
gpio-vx855.c
gpio-wcove.c
gpio-winbond.c
gpio-wm831x.c
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
2019-05-30 11:26:41 -07:00
gpio-xgene-sb.c
gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h
2019-07-31 00:57:21 +02:00
gpio-xgene.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234
2019-06-19 17:09:07 +02:00
gpio-xilinx.c
gpio: xilinx: Fix bug where the wrong GPIO register is written to
2020-02-19 19:53:02 +01:00
gpio-xlp.c
gpio: xlp: Pass irqchip when adding gpiochip
2019-08-15 09:55:07 +02:00
gpio-xra1403.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201
2019-05-30 11:29:52 -07:00
gpio-xtensa.c
gpio: xtensa: fix driver build
2020-01-09 10:19:59 +01:00
gpio-zevio.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
gpio-zx.c
gpio: zx: Pass irqchip when adding gpiochip
2019-08-23 09:40:44 +02:00
gpio-zynq.c
gpio: zynq: Fix for bug in zynq_gpio_restore_context API
2020-01-17 19:48:20 +01:00
gpiolib-acpi.c
gpiolib: acpi: Add honor_wakeup module-option + quirk mechanism
2020-01-14 20:08:28 +01:00
gpiolib-acpi.h
gpiolib: acpi: make acpi_can_fallback_to_crs() static
2019-09-10 11:34:20 +01:00
gpiolib-devprop.c
gpiolib: devprop: Fix syntax error
2019-04-08 11:20:12 +02:00
gpiolib-devres.c
gpio: devres: Switch to EXPORT_SYMBOL_GPL()
2019-09-11 14:47:39 +01:00
gpiolib-legacy.c
gpiolib-of.c
mmc: core: Rework wp-gpio handling
2020-02-19 19:53:10 +01:00
gpiolib-of.h
gpio: of: Make of_get_named_gpiod_flags() private
2019-09-11 14:45:01 +01:00
gpiolib-sysfs.c
gpiolib.c
gpiolib: Set lockdep class for hierarchical irq domains
2020-02-24 08:36:49 +01:00
gpiolib.h
gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h
2019-07-31 00:57:21 +02:00
Kconfig
gpio: max77620: Add missing dependency on GPIOLIB_IRQCHIP
2020-02-01 09:34:45 +00:00
Makefile
ARM: SoC driver updates for v5.4
2019-09-16 15:52:38 -07:00
sgpio-aspeed.c
gpio: aspeed: avoid return type warning
2020-01-26 10:01:09 +01:00
TODO
gpio: Add GPIOLIB_IRQCHIP cleanup to TODO
2019-06-14 10:16:15 +02:00