summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/pm.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2022-04-21 15:31:48 -0500
committerMark Brown <broonie@kernel.org>2022-04-25 13:58:24 +0100
commit8e84b6a4e7f188638748d2ac0455a94799530aa1 (patch)
tree9e2a0ee7c0ea9ccda5d88dcd2850604ef6f77e7f /sound/soc/sof/pm.c
parent57ebd5d568f5e1e34f5a0b67460444d43e9b829b (diff)
downloadlinux-stable-8e84b6a4e7f188638748d2ac0455a94799530aa1.tar.gz
linux-stable-8e84b6a4e7f188638748d2ac0455a94799530aa1.tar.bz2
linux-stable-8e84b6a4e7f188638748d2ac0455a94799530aa1.zip
ASoC: SOF: remove incorrect clearing of prepared flag
When the system is suspended while a PCM is paused, it doesn't receive the SUSPEND trigger. So, the SOF driver has to ensure that the PCM and the widgets associated with the paused PCM are freed in the firmware during suspend. This is handled in the sof_tear_down_left_over_pipelines() call. But since the state of this PCM is SUSPENDED, we end up clearing the prepared flag for the PCM before freeing it. This results in IPC errors while freeing the widgets. But because the widget use_counts are reset to 0 even though the IPC fails, releasing the paused stream after resuming from suspend proceeds normally. Fix the IPC errors by removing the clearing of the prepared flag in sof_set_hw_params_upon_resume(). In fact, we can remove the sof_set_hw_params_upon_resume() and call snd_sof_dsp_hw_params_upon_resume() directly. This will ensure that the PCM is freed in the firmware before the IPC's for freeing the widgets are sent. BugLink: https://github.com/thesofproject/linux/issues/3543 Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Link: https://lore.kernel.org/r/20220421203201.1550328-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/pm.c')
-rw-r--r--sound/soc/sof/pm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index 44008dd075c2..fa3f5514c00f 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -194,7 +194,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
/* prepare for streams to be resumed properly upon resume */
if (!runtime_suspend) {
- ret = sof_set_hw_params_upon_resume(sdev->dev);
+ ret = snd_sof_dsp_hw_params_upon_resume(sdev);
if (ret < 0) {
dev_err(sdev->dev,
"error: setting hw_params flag during suspend %d\n",