[PATCH] ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop

Martin Blumenstingl martin.blumenstingl at googlemail.com
Fri Jun 26 13:47:43 PDT 2026


[ ... ]
>
> > @@ -68,12 +69,16 @@ static int fifo_spdif_trigger(struct snd_pcm_substream *substream, int cmd,
> >       case SNDRV_PCM_TRIGGER_START:
> >       case SNDRV_PCM_TRIGGER_RESUME:
> >       case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> > +             snd_soc_component_write(component, AIU_RST_SOFT,
> > +                                     AIU_RST_SOFT_958_FAST);
> [Severity: High]
> Does this introduce a race condition on start? In fifo_spdif_trigger(),
> aiu_fifo_trigger() is called before the switch statement, which starts the
> upstream DMA engine before we issue the downstream S/PDIF fast domain soft
> reset.
>
> Could this discard audio frames fetched by the DMA into the FIFO before the
> reset, causing left/right channel swapping and audio artifacts?
I don't think so. The sequence introduced by Christian matches the
vendor driver (see my other email with review notes).

> Additionally, the ALSA PCM trigger callback executes in atomic context with
> the stream spinlock held. Is it safe to call snd_soc_component_write() here?
My understanding is that ALSA uses mutex instead of spinlocks, meaning
this comment is incorrect.



More information about the linux-amlogic mailing list