hc
2023-11-06 15ade055295d13f95d49e3d99b09f3bbfb4a43e7
kernel/sound/core/pcm_dmaengine.c
....@@ -27,6 +27,7 @@
2727 #include <sound/soc.h>
2828
2929 #include <sound/dmaengine_pcm.h>
30
+#include "pcm_local.h"
3031
3132 struct dmaengine_pcm_runtime_data {
3233 struct dma_chan *dma_chan;
....@@ -140,11 +141,20 @@
140141 static void dmaengine_pcm_dma_complete(void *arg)
141142 {
142143 struct snd_pcm_substream *substream = arg;
143
- struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
144
+ struct dmaengine_pcm_runtime_data *prtd;
145
+
146
+ snd_pcm_stream_lock_irq(substream);
147
+ if (PCM_RUNTIME_CHECK(substream)) {
148
+ snd_pcm_stream_unlock_irq(substream);
149
+ return;
150
+ }
151
+
152
+ prtd = substream_to_prtd(substream);
144153
145154 prtd->pos += snd_pcm_lib_period_bytes(substream);
146155 if (prtd->pos >= snd_pcm_lib_buffer_bytes(substream))
147156 prtd->pos = 0;
157
+ snd_pcm_stream_unlock_irq(substream);
148158
149159 snd_pcm_period_elapsed(substream);
150160 }