Message ID | 20211207173745.15850-7-pierre-louis.bossart@linux.intel.com |
---|---|
State | Accepted |
Commit | 3aa1e96a2b95e2ece198f8dd01e96818971b84df |
Headers | show |
Series | ASoC : soc-pcm: fix trigger race conditions with shared BE | expand |
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 05a0f52eb11b..7abfc48b26ca 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2140,7 +2140,10 @@ int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) + if (!be->dpcm[stream].be_start && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) goto next; be->dpcm[stream].be_start++;