Skip to content

Commit 88e98af

Browse files
TE-N-ShengjiuWangtiwai
authored andcommitted
ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
When suspended, the DMA channel may enter PAUSE state if dmaengine_pause() is supported by DMA. At this state, dmaengine_synchronize() should not be called, otherwise the DMA channel can't be resumed successfully. Fixes: e834341 ("ALSA: dmaengine: Synchronize dma channel after drop()") Signed-off-by: Shengjiu Wang <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 97b10a7 commit 88e98af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sound/core/pcm_dmaengine.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,12 @@ EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan);
352352
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream)
353353
{
354354
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
355+
struct dma_tx_state state;
356+
enum dma_status status;
355357

356-
dmaengine_synchronize(prtd->dma_chan);
358+
status = dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state);
359+
if (status != DMA_PAUSED)
360+
dmaengine_synchronize(prtd->dma_chan);
357361

358362
return 0;
359363
}

0 commit comments

Comments
 (0)