Skip to content

Commit

Permalink
ALSA: pcm_dmaengine: Don't synchronize DMA channel when DMA is paused
Browse files Browse the repository at this point in the history
commit 88e98af upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
TE-N-ShengjiuWang authored and gregkh committed Jul 27, 2024
1 parent ef88c18 commit 704393c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/core/pcm_dmaengine.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,12 @@ 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;

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

return 0;
}
Expand Down

0 comments on commit 704393c

Please sign in to comment.