aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCezary Rojewski <[email protected]>2022-11-16 12:55:49 +0100
committerMark Brown <[email protected]>2022-11-22 19:32:26 +0000
commitc30c8f9d51ec24b36e2c65a6307a5c8cbc5a0ebc (patch)
treec5dbe15de26e175b26c757e8b6265f52d8977b5a
parentbce3e9f0f655224384c1ce89703cbeec47f4d9bd (diff)
ASoC: Intel: avs: Lock substream before snd_pcm_stop()
snd_pcm_stop() shall be called with stream lock held to prevent any races between nonatomic streaming operations. Fixes: 2f1f570cd730 ("ASoC: Intel: avs: Coredump and recovery flow") Signed-off-by: Cezary Rojewski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/intel/avs/ipc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/intel/avs/ipc.c b/sound/soc/intel/avs/ipc.c
index 152f8d0bdf8e..af8a260093f4 100644
--- a/sound/soc/intel/avs/ipc.c
+++ b/sound/soc/intel/avs/ipc.c
@@ -123,7 +123,10 @@ static void avs_dsp_recovery(struct avs_dev *adev)
if (!substream || !substream->runtime)
continue;
+ /* No need for _irq() as we are in nonatomic context. */
+ snd_pcm_stream_lock(substream);
snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
+ snd_pcm_stream_unlock(substream);
}
}
}