ASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Mon, 7 Nov 2022 08:41:58 +0000 (10:41 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 7 Nov 2022 13:58:23 +0000 (13:58 +0000)
commit18cd1f3227768f4a76c4f7aa95c1256f07ce8647
treecb2fc40e3a42bed622a6ecf97177c5bfb68e80f2
parentbc63a806acdcfca201c68c820731d74185118789
ASoC: SOF: ipc4-topology: Implement tear_down_all_pipelines callback

During system suspend there is a chance that the running stream undergo
an xrun and instead of the expected SNDRV_PCM_TRIGGER_SUSPEND trigger
we will receive SNDRV_PCM_TRIGGER_STOP.

The handling of SUSPEND and STOP triggers differ that case of the later
the sof_pcm_stream_free() will be called with free_widget_list = false.
But we must make sure that all active widgets and streams are free before
entering suspend in order to be able to resume without error.

We can utilize the tear_down_all_pipelines to put the system to an expected
state and to fix the suspend/resume error.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221107084158.26629-1-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc4-topology.c