From: bui duc phuc Date: Tue, 9 Jun 2026 11:38:30 +0000 (+0700) Subject: ASoC: renesas: fsi: Fix register access from in-flight IRQ after shutdown X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e813df3ef5294b1ad548cd21dd8df0d0683873a4;p=thirdparty%2Flinux.git ASoC: renesas: fsi: Fix register access from in-flight IRQ after shutdown In-flight IRQs may still be running when the SPU clock is disabled, leading to register access after shutdown and causing system hangs. Fix this to use fsi_stream_is_working() when handling in-flight IRQ handlers. If no streams are active, the handler now returns immediately to prevent hardware access. Acked-by: Kuninori Morimoto Suggested-by: Kuninori Morimoto Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260609113836.45079-6-phucduc.bui@gmail.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c index 0bd0e0c8c5a3..3e3c6fd7c56b 100644 --- a/sound/soc/renesas/fsi.c +++ b/sound/soc/renesas/fsi.c @@ -470,6 +470,10 @@ static int fsi_get_current_fifo_samples(struct fsi_priv *fsi, static void fsi_count_fifo_err(struct fsi_priv *fsi) { + if (!fsi_stream_is_working(fsi, &fsi->playback) && + !fsi_stream_is_working(fsi, &fsi->capture)) + return; + u32 ostatus = fsi_reg_read(fsi, DOFF_ST); u32 istatus = fsi_reg_read(fsi, DIFF_ST); @@ -681,6 +685,10 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi) u32 data = 0; struct fsi_master *master = fsi_get_master(fsi); + if (!fsi_stream_is_working(fsi, &fsi->playback) && + !fsi_stream_is_working(fsi, &fsi->capture)) + return; + data |= AB_IO(1, fsi_get_port_shift(fsi, &fsi->playback)); data |= AB_IO(1, fsi_get_port_shift(fsi, &fsi->capture));