]> www.infradead.org Git - users/hch/block.git/commit
ASoC: meson: axg-fifo: fix irq scheduling issue with PREEMPT_RT
authorJerome Brunet <jbrunet@baylibre.com>
Wed, 7 Aug 2024 16:27:03 +0000 (18:27 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 8 Aug 2024 19:34:55 +0000 (20:34 +0100)
commit5003d0ce5c7da3a02c0aff771f516f99731e7390
tree184f7ddcca1437de2fe83e700a748abdb1d40cb0
parent2f11f61f9d4d5692bcebb9d089429ee0c046e08a
ASoC: meson: axg-fifo: fix irq scheduling issue with PREEMPT_RT

With PREEMPT_RT enabled a spinlock_t becomes a sleeping lock.

This is usually not a problem with spinlocks used in IRQ context since
IRQ handlers get threaded. However, if IRQF_ONESHOT is set, the primary
handler won't be force-threaded and runs always in hardirq context. This is
a problem because spinlock_t requires a preemptible context on PREEMPT_RT.

In this particular instance, regmap mmio uses spinlock_t to protect the
register access and IRQF_ONESHOT is set on the IRQ. In this case, it is
actually better to do everything in threaded handler and it solves the
problem with PREEMPT_RT.

Reported-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Closes: https://lore.kernel.org/linux-amlogic/20240729131652.3012327-1-avkrasnov@salutedevices.com
Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Fixes: b11d26660dff ("ASoC: meson: axg-fifo: use threaded irq to check periods")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20240807162705.4024136-1-jbrunet@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/meson/axg-fifo.c