linux/drivers/pinctrl/intel
Mika Westerberg 109fdf1572 pinctrl: cherryview: Use raw_spinlock for locking
When running -rt kernel and an interrupt happens on a GPIO line controlled by
Intel Cherryview/Braswell pinctrl driver we get:

 BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0
 Preemption disabled at:[<ffffffff81092e9f>] cpu_startup_entry+0x17f/0x480

 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.5-rt5 #16
  ...
 Call Trace:
  <IRQ>  [<ffffffff816283c6>] dump_stack+0x4a/0x61
  [<ffffffff81077e17>] ___might_sleep+0xe7/0x170
  [<ffffffff8162d6cf>] rt_spin_lock+0x1f/0x50
  [<ffffffff812e52ed>] chv_gpio_irq_ack+0x3d/0xa0
  [<ffffffff810a72f5>] handle_edge_irq+0x75/0x180
  [<ffffffff810a3457>] generic_handle_irq+0x27/0x40
  [<ffffffff812e57de>] chv_gpio_irq_handler+0x7e/0x110
  [<ffffffff810050aa>] handle_irq+0xaa/0x190
  ...

This is because desc->lock is raw_spinlock and is held when chv_gpio_irq_ack()
is called by the genirq core. chv_gpio_irq_ack() in turn takes pctrl->lock
which in -rt is an rt-mutex causing might_sleep() rightfully to complain about
sleeping function called from invalid context.

In order to keep -rt happy but at the same time make sure that register
accesses get serialized, convert the driver to use raw_spinlock instead.

Suggested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2015-08-26 09:27:39 +02:00
..
Kconfig pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support 2015-04-07 15:15:23 +02:00
Makefile pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support 2015-04-07 15:15:23 +02:00
pinctrl-baytrail.c pinctrl: baytrail: Use raw_spinlock for locking 2015-08-26 09:25:33 +02:00
pinctrl-cherryview.c pinctrl: cherryview: Use raw_spinlock for locking 2015-08-26 09:27:39 +02:00
pinctrl-intel.c pinctrl: Use irq_desc_get_xxx() to avoid redundant lookup of irq_desc 2015-07-17 21:56:20 +02:00
pinctrl-intel.h pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support 2015-04-07 15:15:23 +02:00
pinctrl-sunrisepoint.c pinctrl: intel: sunrisepoint: Add Intel Sunrisepoint-H support 2015-05-12 13:17:41 +02:00