Skip to content

Commit

Permalink
ASoC: SOF: Intel: hda: handle only paused streams in hda_dai_suspend()
Browse files Browse the repository at this point in the history
hda_dai_suspend() was added to handle paused stream during system
suspend. But as a side effect, it also ends up cleaning up the DMA
data for those streams that were prepared but not triggered before a
system suspend. Since these streams will not receive the prepare
callback after resuming, we need to preserve the DMA data during suspend.
So, add the check to handle only those streams that are in the paused
state to avoid losing the DMA data for all other streams.

Link: thesofproject#5080
Signed-off-by: Ranjani Sridharan <[email protected]>
Reviewed-by: Fred Oh <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Péter Ujfalusi <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Bard Liao <[email protected]>
  • Loading branch information
ranj063 authored and bardliao committed Oct 23, 2024
1 parent e97f3f2 commit 048ea2a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/sof/intel/hda-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,10 @@ static int hda_dai_suspend(struct hdac_bus *bus)
sdai = swidget->private;
ops = sdai->platform_private;

if (rtd->dpcm[hext_stream->link_substream->stream].state !=
SND_SOC_DPCM_STATE_PAUSED)
continue;

/* for consistency with TRIGGER_SUSPEND */
if (ops->post_trigger) {
ret = ops->post_trigger(sdev, cpu_dai,
Expand Down

0 comments on commit 048ea2a

Please sign in to comment.