linux_old1/drivers/gpio
Semen Protsenko 09afa276d5 gpio: max732x: Fix possible deadlock
This patch was derived from next one:
"gpio: fix pca953x set_type 'scheduling while atomic' bug".

After adding entry that consumes max732x GPIO as interrupt line to dts
file, deadlock appears somewhere in max732x probe function.

Deadlock caught by lockdep (from kernel log):
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>
[    0.473419] ======================================================
[    0.473419] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ]
[    0.473449] 3.x.xx-xxxxx-xxxxxxxx-dirty #2 Tainted: G        W
[    0.473449] ------------------------------------------------------
[    0.473449] swapper/0/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
[    0.473449]  (&lock->wait_lock){+.+...}, at: [<c072e350>] rt_mutex_trylock+0xc/0x74
[    0.473480]
[    0.473480] and this task is already holding:
[    0.473510]  (&chip->lock){......}, at: [<c0314514>] max732x_gpio_set_value+0x2c/0xa4
[    0.473541] which would create a new lock dependency:
[    0.473541]  (&chip->lock){......} -> (&lock->wait_lock){+.+...}

...

[    0.474273]  *** DEADLOCK ***
[    0.474273]
[    0.474273] 5 locks held by swapper/0/1:
[    0.474273]  #0:  (&__lockdep_no_validate__){......}, at: [<c03b2328>] __driver_attach+0x48/0x98
[    0.474304]  #1:  (&__lockdep_no_validate__){......}, at: [<c03b2338>] __driver_attach+0x58/0x98
[    0.474334]  #2:  (&chip->irq_lock){+.+...}, at: [<c0313e3c>] max732x_irq_bus_lock+0x14/0x20
[    0.474365]  #3:  (&irq_desc_lock_class){-.....}, at: [<c00a65a4>] __irq_get_desc_lock+0x48/0x88
[    0.474365]  #4:  (&chip->lock){......}, at: [<c0314514>] max732x_gpio
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< cut here >>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Semen Protsenko <semen.protsenko@globallogic.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-01-15 18:03:49 +01:00
..
Kconfig gpio: max732x: Rewrite IRQ code to use irq_domain API 2015-01-15 17:53:56 +01:00
Makefile This is the bulk of GPIO changes for the v3.19 series: 2014-12-14 14:05:05 -08:00
devres.c gpio: Support for unified device properties interface 2014-11-04 21:58:23 +01:00
gpio-74x164.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-74xx-mmio.c GPIO: Add driver for 74xx-ICs with MMIO access 2014-10-21 10:48:04 +02:00
gpio-adnp.c gpio: adnp: switch to use irqchip helpers 2014-09-02 10:44:01 +02:00
gpio-adp5520.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-adp5588.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-amd8111.c gpio-amd8111: check ioport_map return value 2015-01-15 17:23:21 +01:00
gpio-arizona.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-bcm-kona.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-bt8xx.c gpio: bt8xx: fix release of managed resources 2014-08-29 14:31:43 +02:00
gpio-clps711x.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-crystalcove.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-cs5535.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-da9052.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-da9055.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-davinci.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-dln2.c gpio: add support for the Diolan DLN-2 USB GPIO driver 2014-11-10 16:30:09 +00:00
gpio-dwapb.c gpio: dwapb: Convert to use resource managed APIs 2015-01-15 17:23:21 +01:00
gpio-em.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-ep93xx.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-f7188x.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-ge.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-generic.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-grgpio.c gpio: grgpio: off by one in grgpio_to_irq() 2015-01-15 17:23:19 +01:00
gpio-ich.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-intel-mid.c gpio: intel-mid: switch to using gpiolib irqchip helpers 2014-06-19 09:31:16 +02:00
gpio-iop.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-it8761e.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-janz-ttl.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-kempld.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-ks8695.c gpio: ks8695: fix 'else should follow close brace '}'' 2014-10-02 16:07:00 +02:00
gpio-lp3943.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-lpc32xx.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-lynxpoint.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-max730x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-max732x.c gpio: max732x: Fix possible deadlock 2015-01-15 18:03:49 +01:00
gpio-max7300.c gpio: max7300: use devm_kzalloc() 2013-03-27 16:05:11 +01:00
gpio-max7301.c gpio: max7301: Reverting "Do not force SPI speed when using OF Platform" 2013-08-23 19:44:28 +02:00
gpio-mc9s08dz60.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-mc33880.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-mcp23s08.c gpio: mcp23s08: fix up compilation error 2014-12-12 11:22:11 +01:00
gpio-ml-ioh.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-mm-lantiq.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-moxart.c gpio: moxart: convert to use basic mmio gpio library 2015-01-09 10:24:29 +01:00
gpio-mpc8xxx.c gpio-mpc8xxx: add mpc8xxx_gpio_set_multiple function 2014-11-27 15:01:18 +01:00
gpio-mpc5200.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-msic.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-msm-v1.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-msm-v2.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-mvebu.c gpio: mvebu: Fix probe cleanup on error 2015-01-15 17:23:24 +01:00
gpio-mxc.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-mxs.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-octeon.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-omap.c This is the bulk of GPIO changes for the v3.19 series: 2014-12-14 14:05:05 -08:00
gpio-palmas.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-pca953x.c gpio: pca953x: Drop deprecated DT bindings 2014-08-28 14:19:40 +02:00
gpio-pcf857x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-pch.c gpio: pch: Build context save/restore only for PM 2014-10-02 16:07:00 +02:00
gpio-pl061.c gpio: pl061: hook request if gpio-ranges avaiable 2014-12-03 14:44:23 +01:00
gpio-pxa.c gpio-pxa: gpio0 and gpio1 support on dt 2014-07-07 12:54:28 +02:00
gpio-rc5t583.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-rcar.c gpio: rcar: Switch to use gpiolib irqchip helpers 2015-01-15 17:23:25 +01:00
gpio-rdc321x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-sa1100.c ARM: 7841/1: sa1100: remove complex GPIO interface 2013-10-29 11:01:02 +00:00
gpio-samsung.c gpio: samsung: Remove remaining check for CONFIG_S5P_GPIO_DRVSTR 2014-09-23 17:51:39 +02:00
gpio-sch.c gpio: sch: Add support for Intel Quark X1000 SoC 2015-01-15 17:23:12 +01:00
gpio-sch311x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-sodaville.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-spear-spics.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-sta2x11.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-stmpe.c gpio: stmpe: add verbose debug code 2014-10-02 16:06:59 +02:00
gpio-stp-xway.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-sx150x.c gpio: sx150x: Fix comparing wrong value with chip->irq_masked 2015-01-15 17:23:20 +01:00
gpio-syscon.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-tb10x.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-tc3589x.c gpio: tc3589x: get rid of platform data 2015-01-15 17:23:19 +01:00
gpio-tegra.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-timberdale.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-tps6586x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-tps65910.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-tps65912.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-ts5500.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-twl4030.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-twl6040.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-tz1090-pdc.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-tz1090.c gpio: tz1090: Use resource_size to fix off-by-one 2015-01-15 17:23:21 +01:00
gpio-ucb1400.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-vf610.c gpio: drop owner assignment from platform_drivers 2015-01-15 17:23:20 +01:00
gpio-viperboard.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-vr41xx.c Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
gpio-vx855.c gpio: vx855: Switch to use managed resources APIs 2015-01-15 17:23:18 +01:00
gpio-wm831x.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-wm8350.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-wm8994.c gpio: remove all usage of gpio_remove retval in driver/gpio 2014-07-22 16:39:26 +02:00
gpio-xgene.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-xilinx.c gpio/xilinx: Use of_mm_gpiochip_remove 2015-01-15 17:23:18 +01:00
gpio-xtensa.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-zevio.c gpio: drop owner assignment from platform_drivers 2014-10-20 16:20:31 +02:00
gpio-zynq.c PM: Merge the SET*_RUNTIME_PM_OPS() macros 2014-12-04 00:51:30 +01:00
gpiolib-acpi.c This is the bulk of GPIO changes for the v3.19 series: 2014-12-14 14:05:05 -08:00
gpiolib-legacy.c gpio: fix deferred probe detection for legacy API 2014-12-02 15:46:36 +01:00
gpiolib-of.c gpio/gpiolib-of: Create of_mm_gpiochip_remove 2015-01-15 17:23:17 +01:00
gpiolib-sysfs.c gpio: remove const modifier from gpiod_get_direction() 2014-11-28 14:43:36 +01:00
gpiolib.c gpio:gpiolib: use static const char const * for a suffixes array 2015-01-15 17:23:22 +01:00
gpiolib.h gpio / ACPI: Add support for _DSD device properties 2014-11-04 21:58:22 +01:00