]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/ls-extirq: Fix invalid wait context by avoiding to use regmap
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 28 Jul 2022 14:42:54 +0000 (17:42 +0300)
committerMarc Zyngier <maz@kernel.org>
Mon, 3 Oct 2022 15:29:17 +0000 (16:29 +0100)
commitdf82282b86169b4c77fea16456a18728d8581570
treecf04c9e336b609e4ff8ea6dc2be4b569d6e787e8
parent56d722e80a27cef52ee9c473dbea069f0b39ce44
irqchip/ls-extirq: Fix invalid wait context by avoiding to use regmap

The irqchip->irq_set_type method is called by __irq_set_trigger() under
the desc->lock raw spinlock.

The ls-extirq implementation, ls_extirq_irq_set_type(), uses an MMIO
regmap created by of_syscon_register(), which uses plain spinlocks
(the kind that are sleepable on RT).

Therefore, this is an invalid locking scheme for which we get a kernel
splat stating just that ("[ BUG: Invalid wait context ]"), because the
context in which the plain spinlock may sleep is atomic due to the raw
spinlock. We need to go raw spinlocks all the way.

Make this driver ioremap its INTPCR register on its own, and stop
relying on syscon to provide a regmap.

Fixes: 29609c66304b ("irqchip: Add support for Layerscape external interrupt lines")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
[maz: trimmed down commit log]
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220728144254.175385-1-vladimir.oltean@nxp.com
drivers/irqchip/irq-ls-extirq.c