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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:40 +0000 (11:51 +0100)
commit3c124f09b7ff0434b076a8dec1ed446a6170b549
tree73ed09d70a392d7d9dab839d1c7358c77415204f
parente8879e7a7b4e880d6c9b9a12a0ef13247c5c0b33
ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores

[ Upstream commit 31ed8da1c8e5e504710bb36863700e3389f8fc81 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/sof/sof-audio.c