]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-6.6/asoc-sof-intel-hda-dsp-skip-imr-boot-on-ace-platform.patch
Fixes for 6.6
[thirdparty/kernel/stable-queue.git] / queue-6.6 / asoc-sof-intel-hda-dsp-skip-imr-boot-on-ace-platform.patch
1 From e32ff43a3c6dfd2f06fb21a1095ff6973d72f5b1 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Fri, 22 Mar 2024 13:25:04 +0200
4 Subject: ASoC: SOF: Intel: hda-dsp: Skip IMR boot on ACE platforms in case of
5 S3 suspend
6
7 From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
8
9 [ Upstream commit c61115b37ff964d63191dbf4a058f481daabdf57 ]
10
11 SoCs with ACE architecture are tailored to use s2idle instead deep (S3)
12 suspend state and the IMR content is lost when the system is forced to
13 enter even to S3.
14 When waking up from S3 state the IMR boot will fail as the content is lost.
15 Set the skip_imr_boot flag to make sure that we don't try IMR in this case.
16
17 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
18 Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
19 Reviewed-by: Rander Wang <rander.wang@intel.com>
20 Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
21 Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
22 Link: https://msgid.link/r/20240322112504.4192-1-peter.ujfalusi@linux.intel.com
23 Signed-off-by: Mark Brown <broonie@kernel.org>
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 sound/soc/sof/intel/hda-dsp.c | 20 +++++++++++++++-----
27 1 file changed, 15 insertions(+), 5 deletions(-)
28
29 diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
30 index 44f39a520bb39..e80a2a5ec56a1 100644
31 --- a/sound/soc/sof/intel/hda-dsp.c
32 +++ b/sound/soc/sof/intel/hda-dsp.c
33 @@ -681,17 +681,27 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)
34 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
35 const struct sof_intel_dsp_desc *chip = hda->desc;
36 struct hdac_bus *bus = sof_to_bus(sdev);
37 + bool imr_lost = false;
38 int ret, j;
39
40 /*
41 - * The memory used for IMR boot loses its content in deeper than S3 state
42 - * We must not try IMR boot on next power up (as it will fail).
43 - *
44 + * The memory used for IMR boot loses its content in deeper than S3
45 + * state on CAVS platforms.
46 + * On ACE platforms due to the system architecture the IMR content is
47 + * lost at S3 state already, they are tailored for s2idle use.
48 + * We must not try IMR boot on next power up in these cases as it will
49 + * fail.
50 + */
51 + if (sdev->system_suspend_target > SOF_SUSPEND_S3 ||
52 + (chip->hw_ip_version >= SOF_INTEL_ACE_1_0 &&
53 + sdev->system_suspend_target == SOF_SUSPEND_S3))
54 + imr_lost = true;
55 +
56 + /*
57 * In case of firmware crash or boot failure set the skip_imr_boot to true
58 * as well in order to try to re-load the firmware to do a 'cold' boot.
59 */
60 - if (sdev->system_suspend_target > SOF_SUSPEND_S3 ||
61 - sdev->fw_state == SOF_FW_CRASHED ||
62 + if (imr_lost || sdev->fw_state == SOF_FW_CRASHED ||
63 sdev->fw_state == SOF_FW_BOOT_FAILED)
64 hda->skip_imr_boot = true;
65
66 --
67 2.43.0
68