[PATCH] ASoC: meson: axg-fifo: request the irq with the clock enabled
Jerome Brunet
jbrunet at baylibre.com
Fri Oct 30 10:14:56 PDT 2026
The fifo irq handler accesses registers which need pclk, but the irq is
requested before pclk is enabled on open and freed after it is disabled
on close.
Request the irq after enabling pclk and masking the fifo irqs.
Free it before disabling pclk.
Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
Reported-by: Sashiko <sashiko-bot at kernel.org>
Closes: https://sashiko.dev/#/bug/linux-30e88a8a-f33a-40f0-92aa-9ea62c5b7299
Signed-off-by: Jerome Brunet <jbrunet at baylibre.com>
---
sound/soc/meson/axg-fifo.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
index 75909196b769..edf43b7fb5cf 100644
--- a/sound/soc/meson/axg-fifo.c
+++ b/sound/soc/meson/axg-fifo.c
@@ -244,17 +244,10 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
if (ret)
return ret;
- /* Use the threaded irq handler only with non-atomic links */
- ret = request_threaded_irq(fifo->irq, NULL,
- axg_fifo_pcm_irq_block,
- IRQF_ONESHOT, dev_name(dev), ss);
- if (ret)
- return ret;
-
/* Enable pclk to access registers and clock the fifo ip */
ret = clk_prepare_enable(fifo->pclk);
if (ret)
- goto free_irq;
+ return ret;
/* Setup status2 so it reports the memory pointer */
regmap_update_bits(fifo->map, FIFO_CTRL1,
@@ -271,17 +264,24 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
/* Clear any pending interrupt */
axg_fifo_ack_irq(fifo, FIFO_INT_MASK);
+ /* Use the threaded irq handler only with non-atomic links */
+ ret = request_threaded_irq(fifo->irq, NULL,
+ axg_fifo_pcm_irq_block,
+ IRQF_ONESHOT, dev_name(dev), ss);
+ if (ret)
+ goto free_clk;
+
/* Take memory arbitror out of reset */
ret = reset_control_deassert(fifo->arb);
if (ret)
- goto free_clk;
+ goto free_irq;
return 0;
-free_clk:
- clk_disable_unprepare(fifo->pclk);
free_irq:
free_irq(fifo->irq, ss);
+free_clk:
+ clk_disable_unprepare(fifo->pclk);
return ret;
}
EXPORT_SYMBOL_GPL(axg_fifo_pcm_open);
@@ -295,12 +295,12 @@ int axg_fifo_pcm_close(struct snd_soc_component *component,
/* Put the memory arbitror back in reset */
ret = reset_control_assert(fifo->arb);
- /* Disable fifo ip and register access */
- clk_disable_unprepare(fifo->pclk);
-
/* remove IRQ */
free_irq(fifo->irq, ss);
+ /* Disable fifo ip and register access */
+ clk_disable_unprepare(fifo->pclk);
+
return ret;
}
EXPORT_SYMBOL_GPL(axg_fifo_pcm_close);
---
base-commit: 11ae63bd9030349a0136fb2edd1622a4a029edc8
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
change-id: 20261030-asoc-axg-fifo-irq-clock-120278536630
Best regards,
--
Jerome
More information about the linux-arm-kernel
mailing list