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)
commit1b00adce8afdb842615a5bf3774510f14a9b769a
treecf04c9e336b609e4ff8ea6dc2be4b569d6e787e8
parent732d69c80cb04a587d9ec2935bcb63989e66eb92
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: 0dcd9f872769 ("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