summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/pm.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2021-12-23 13:36:15 +0200
committerMark Brown <broonie@kernel.org>2021-12-23 13:38:15 +0000
commit4e1f86482189ddbef73f7be8c6e62e8e3730e6b9 (patch)
tree8826f6f50d25c097a06f506cd25b4d18fb2212e3 /sound/soc/sof/pm.c
parent2f148430b96e975e895163d763bfc9c5088100eb (diff)
downloadlinux-stable-4e1f86482189ddbef73f7be8c6e62e8e3730e6b9.tar.gz
linux-stable-4e1f86482189ddbef73f7be8c6e62e8e3730e6b9.tar.bz2
linux-stable-4e1f86482189ddbef73f7be8c6e62e8e3730e6b9.zip
ASoC: SOF: Introduce new firmware state: SOF_FW_CRASHED
The SOF_FW_CRASHED state is meant to indicate the unfortunate case when the firmware has crashed after a successful boot. IPC tx timeout is not treated as indication of a firmware crash as it tends to happen regularly while the firmware is operational. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com> Link: https://lore.kernel.org/r/20211223113628.18582-8-peter.ujfalusi@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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index ac8ae6e422a7..f22b5ee23478 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -312,6 +312,13 @@ int snd_sof_prepare(struct device *dev)
/* will suspend to S3 by default */
sdev->system_suspend_target = SOF_SUSPEND_S3;
+ /*
+ * if the firmware is crashed then we try to aim for S3 to reboot the
+ * firmware
+ */
+ if (sdev->fw_state == SOF_FW_CRASHED)
+ return 0;
+
if (!desc->use_acpi_target_states)
return 0;