ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Fri, 24 Nov 2023 13:57:43 +0000 (15:57 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 24 Nov 2023 14:15:06 +0000 (14:15 +0000)
commit31ed8da1c8e5e504710bb36863700e3389f8fc81
tree31439f664aa8b3e37e9748a59b046d25ce733f8c
parent0376b995bb7a65fb0c056f3adc5e9695ad0c1805
ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores

In the current code, we enable a widget core when it is set up and
disable it when it is freed. This is problematic with IPC4 because
widget free is essentially a NOP and all widgets are freed in the
firmware when the pipeline is deleted. This results in a crash during
pipeline deletion when one of it's widgets is scheduled to run on a
secondary core and is powered off when widget is freed. So, change the
logic to enable all cores needed by all the modules in a pipeline when
the pipeline widget is set up and disable them after the pipeline
widget is freed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20231124135743.24674-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/sof-audio.c