[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <66bccfab-66f0-4e67-8c81-24de09b85a81@csgroup.eu>
Date: Thu, 10 Apr 2025 14:24:24 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Herve Codina <herve.codina@...tlin.com>,
Shengjiu Wang <shengjiu.wang@...il.com>, Xiubo Li <Xiubo.Lee@...il.com>,
Fabio Estevam <festevam@...il.com>, Nicolin Chen <nicoleotsuka@...il.com>,
Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>
Cc: linux-sound@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, Thomas Petazzoni
<thomas.petazzoni@...tlin.com>, stable@...r.kernel.org
Subject: Re: [PATCH] ASoC: fsl: fsl_qmc_audio: Reset audio data pointers on
TRIGGER_START event
Le 10/04/2025 à 11:16, Herve Codina a écrit :
> On SNDRV_PCM_TRIGGER_START event, audio data pointers are not reset.
>
> This leads to wrong data buffer usage when multiple TRIGGER_START are
> received and ends to incorrect buffer usage between the user-space and
> the driver. Indeed, the driver can read data that are not already set by
> the user-space or the user-space and the driver are writing and reading
> the same area.
>
> Fix that resetting data pointers on each SNDRV_PCM_TRIGGER_START events.
>
> Fixes: 075c7125b11c ("ASoC: fsl: Add support for QMC audio")
> Cc: stable@...r.kernel.org
> Signed-off-by: Herve Codina <herve.codina@...tlin.com>
Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>
Tested-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
> sound/soc/fsl/fsl_qmc_audio.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c
> index b2979290c973..5614a8b909ed 100644
> --- a/sound/soc/fsl/fsl_qmc_audio.c
> +++ b/sound/soc/fsl/fsl_qmc_audio.c
> @@ -250,6 +250,9 @@ static int qmc_audio_pcm_trigger(struct snd_soc_component *component,
> switch (cmd) {
> case SNDRV_PCM_TRIGGER_START:
> bitmap_zero(prtd->chans_pending, 64);
> + prtd->buffer_ended = 0;
> + prtd->ch_dma_addr_current = prtd->ch_dma_addr_start;
> +
> if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
> for (i = 0; i < prtd->channels; i++)
> prtd->qmc_dai->chans[i].prtd_tx = prtd;
Powered by blists - more mailing lists