summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2025-10-23 11:23:46 +0200
committerMark Brown <broonie@kernel.org>2025-10-23 13:42:25 +0100
commitcfca1637bc2b6b1e4f191d2f0b25f12402fbbb26 (patch)
treefe214076f279b0ceae030bbb266d3cf18ac98471 /sound/soc
parent3293d3d7b08872cf174bb768b890655f1b22526a (diff)
downloadlinux-cfca1637bc2b6b1e4f191d2f0b25f12402fbbb26.tar.gz
linux-cfca1637bc2b6b1e4f191d2f0b25f12402fbbb26.tar.bz2
linux-cfca1637bc2b6b1e4f191d2f0b25f12402fbbb26.zip
ASoC: Intel: avs: Unprepare a stream when XRUN occurs
The pcm->prepare() function may be called multiple times in a row by the userspace, as mentioned in the documentation. The driver shall take that into account and prevent redundancy. However, the exact same function is called during XRUNs and in such case, the particular stream shall be reset and setup anew. Fixes: 9114700b496c ("ASoC: Intel: avs: Generic PCM FE operations") Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://patch.msgid.link/20251023092348.3119313-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/intel/avs/pcm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index d31058e2de5b..501466bd1f7f 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -754,6 +754,8 @@ static int avs_dai_fe_prepare(struct snd_pcm_substream *substream, struct snd_so
data = snd_soc_dai_get_dma_data(dai, substream);
host_stream = data->host_stream;
+ if (runtime->state == SNDRV_PCM_STATE_XRUN)
+ hdac_stream(host_stream)->prepared = false;
if (hdac_stream(host_stream)->prepared)
return 0;