linux-stable/drivers/pinctrl
Mika Westerberg 27d9098cff pinctrl: intel: Use raw_spinlock for locking
When running -rt kernel and GPIO interrupt happens we get following

 BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:931
 in_atomic(): 1, irqs_disabled(): 0, pid: 530, name: irq/14-INT3452:
 Preemption disabled at:[<ffffffff810b4dab>] handle_edge_irq+0x1b/0x190

 CPU: 0 PID: 530 Comm: irq/14-INT3452: Not tainted 4.6.2-rt5 #1060
  0000000000000000 ffff88007a257d58 ffffffff812d8494 0000000000000000
  ffff88017a330000 ffff88007a257d78 ffffffff81083a11 ffff88007a252430
  ffff88007a252430 ffff88007a257d90 ffffffff8167ef20 000000000000001a
 Call Trace:
  [<ffffffff812d8494>] dump_stack+0x4f/0x6b
  [<ffffffff81083a11>] ___might_sleep+0xe1/0x160
  [<ffffffff8167ef20>] rt_spin_lock+0x20/0x50
  [<ffffffff81308c6d>] intel_gpio_irq_ack+0x2d/0x80
  [<ffffffff810b4e0b>] handle_edge_irq+0x7b/0x190
  [<ffffffff810b0d82>] generic_handle_irq+0x22/0x30
  [<ffffffff81307abc>] intel_gpio_irq+0xdc/0x150
  [<ffffffff810b2293>] irq_forced_thread_fn+0x23/0x70
  [<ffffffff810b250b>] irq_thread+0x13b/0x1d0
  [<ffffffff8167b844>] ? __schedule+0x2e4/0x5a0
  [<ffffffff810b2270>] ? irq_finalize_oneshot.part.37+0xd0/0xd0
  [<ffffffff810b25a0>] ? irq_thread+0x1d0/0x1d0
  [<ffffffff810b23d0>] ? wake_threads_waitq+0x30/0x30
  [<ffffffff8107e624>] kthread+0xd4/0xf0
  [<ffffffff8167ec27>] ? _raw_spin_unlock_irq+0x17/0x40
  [<ffffffff8167f592>] ret_from_fork+0x22/0x40
  [<ffffffff8107e550>] ? kthread_worker_fn+0x190/0x190

The reason why this happens is because intel_gpio_irq_ack() is called with
desc->lock raw_spinlock locked which cannot sleep but our normal spinlock
(which is converted to rtmutex in -rt) is allowed to sleep. This causes
might_sleep() to trigger.

Fix this by converting the normal spinlock to a raw_spinlock.

Reported-by: Kim Tatt Chuah <kim.tatt.chuah@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2016-06-18 10:35:44 +02:00
..
bcm pinctrl: nsp-gpio: fix non-static functions 2016-06-08 14:09:49 +02:00
berlin pinctrl: berlin: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:02:13 +02:00
freescale pinctrl: fix incorrect inline keyword in multiple drivers 2016-06-15 08:37:41 +02:00
intel pinctrl: intel: Use raw_spinlock for locking 2016-06-18 10:35:44 +02:00
mediatek pinctrl: mediatek: fix suspend/resume timing issue 2016-06-08 10:09:40 +02:00
meson pinctrl: amlogic: gxbb: add ethernet pins 2016-05-31 10:37:09 +02:00
mvebu pinctrl: mvebu: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:02:39 +02:00
nomadik pinctrl: nomadik: fix warnings from unexported functions 2016-06-13 08:50:13 +02:00
pxa pinctrl: pxa: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:04 +02:00
qcom pinctrl: qcom-ssbi: support for PM8058 2016-06-15 08:37:31 +02:00
samsung pinctrl: samsung: Suppress unbinding to prevent theoretical attacks 2016-05-30 09:41:49 +02:00
sh-pfc Pin control bulk changes for the v4.7 kernel cycle: 2016-05-19 12:50:56 -07:00
sirf pinctrl: sirf/atlas7: trivial fix of spelling mistake on flagged 2016-04-29 11:30:35 +02:00
spear pinctrl: spear: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 00:03:18 +02:00
stm32 pinctrl: stm32: factorize stm32_pconf_input/output_get() 2016-05-31 10:06:12 +02:00
sunxi Pin control bulk changes for the v4.7 kernel cycle: 2016-05-19 12:50:56 -07:00
tegra pinctrl: tegra: Get rid of parked_reg 2016-05-30 09:41:46 +02:00
uniphier pinctrl: uniphier: fix meaningless drive control offsets 2016-06-18 10:03:09 +02:00
vt8500 pinctrl: vt8500: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:20 +02:00
core.c pinctrl: copy per-pin driver private data to struct pin_desc 2016-05-31 10:27:19 +02:00
core.h pinctrl: copy per-pin driver private data to struct pin_desc 2016-05-31 10:27:19 +02:00
devicetree.c pinctrl: simplify of_pinctrl_get() 2015-07-16 09:39:03 +02:00
devicetree.h
Kconfig pinctrl: max77620: select PINMUX 2016-06-15 08:37:41 +02:00
Makefile pinctrl: Always recurse into bcm folder 2016-06-13 09:25:31 +02:00
pinconf-generic.c pinctrl: pinconf: separate config parameters with commas for debugfs 2016-05-31 10:29:06 +02:00
pinconf.c pinctrl: pinconf: separate config parameters with commas for debugfs 2016-05-31 10:29:06 +02:00
pinconf.h
pinctrl-adi2-bf54x.c
pinctrl-adi2-bf60x.c added tabs instead of spaces 2015-07-16 09:39:01 +02:00
pinctrl-adi2.c pinctrl: adi2: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:20 +02:00
pinctrl-adi2.h
pinctrl-amd.c pinctrl: amd: make it explicitly non-modular 2016-06-13 08:29:20 +02:00
pinctrl-amd.h Fix inconsistent spinlock of AMD GPIO driver which can be 2015-04-07 11:36:49 +02:00
pinctrl-as3722.c pinctrl: as3722: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:21 +02:00
pinctrl-at91-pio4.c pinctrl: at91-pio4: make it explicitly non-modular 2016-06-13 08:40:14 +02:00
pinctrl-at91.c pinctrl: fix incorrect inline keyword in multiple drivers 2016-06-15 08:37:41 +02:00
pinctrl-at91.h
pinctrl-coh901.c pinctrl: coh901: fix initconst annotation 2016-02-15 20:40:52 +01:00
pinctrl-coh901.h
pinctrl-digicolor.c pinctrl: digicolor: make it explicitly non-modular 2016-06-13 08:32:19 +02:00
pinctrl-falcon.c staging: drivers: pinctrl: Fixed checkpatch.pl warnings 2015-01-21 11:02:26 +01:00
pinctrl-lantiq.c pinctrl: lantiq: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:23 +02:00
pinctrl-lantiq.h pinctrl/lantiq: introduce new dedicated devicetree bindings 2015-11-30 13:12:07 +01:00
pinctrl-lpc18xx.c pinctrl: lpc18xx: make it explicitly non-modular 2016-06-13 08:28:18 +02:00
pinctrl-max77620.c pinctrl: max77620: Remove unused structure definition 2016-06-15 08:37:40 +02:00
pinctrl-oxnas.c pinctrl: oxnas: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-05-31 12:59:29 +02:00
pinctrl-palmas.c pinctrl: palmas: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:23 +02:00
pinctrl-pic32.c pinctrl: pic32: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:24 +02:00
pinctrl-pic32.h pinctrl: pinctrl-pic32: Add PIC32 pin control driver 2016-02-05 23:54:47 +01:00
pinctrl-pistachio.c Pin control bulk changes for the v4.7 kernel cycle: 2016-05-19 12:50:56 -07:00
pinctrl-rockchip.c pinctrl: fix incorrect inline keyword in multiple drivers 2016-06-15 08:37:41 +02:00
pinctrl-single.c pinctrl: single: Fix pcs_parse_bits_in_pinctrl_entry to use __ffs than ffs 2016-04-15 11:26:55 +02:00
pinctrl-st.c pinctrl: fix incorrect inline keyword in multiple drivers 2016-06-15 08:37:41 +02:00
pinctrl-tb10x.c pinctrl: tb10x: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:25 +02:00
pinctrl-tz1090-pdc.c pinctrl: tz1090-pdc: Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:26 +02:00
pinctrl-tz1090.c pinctrl: tz1090 Use devm_pinctrl_register() for pinctrl registration 2016-04-21 09:23:26 +02:00
pinctrl-u300.c pinctrl: u300: make u300_pmx_registers static 2016-06-13 09:27:43 +02:00
pinctrl-utils.c pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-utils.h pinctrl: Rename pinctrl_utils_dt_free_map to pinctrl_utils_free_map 2016-04-01 15:06:36 +02:00
pinctrl-xway.c pinctrl: xway: Change structure initialisation to c99 style 2016-06-13 14:03:18 +02:00
pinctrl-zynq.c pinctrl: zynq: make it explicitly non-modular 2016-06-13 08:30:58 +02:00
pinmux.c pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure 2016-05-31 10:33:00 +02:00
pinmux.h