Commit 88e98af9 authored by Shengjiu Wang's avatar Shengjiu Wang Committed by Takashi Iwai
Browse files

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: e8343410 ("ALSA: dmaengine: Synchronize dma channel after drop()")
Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/1721198693-27636-1-git-send-email-shengjiu.wang@nxp.com


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 97b10a77
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -352,7 +352,11 @@ EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan);
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream)
{
	struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
	struct dma_tx_state state;
	enum dma_status status;

	status = dmaengine_tx_status(prtd->dma_chan, prtd->cookie, &state);
	if (status != DMA_PAUSED)
		dmaengine_synchronize(prtd->dma_chan);

	return 0;