From: Greg Kroah-Hartman Date: Wed, 27 Jul 2022 10:15:17 +0000 (+0200) Subject: 5.18-stable patches X-Git-Tag: v4.9.325~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfb50a233e8070b5206386061d92fc4ddfce1634;p=thirdparty%2Fkernel%2Fstable-queue.git 5.18-stable patches added patches: asoc-sof-intel-disable-imr-boot-when-resuming-from-acpi-s4-and-s5-states.patch asoc-sof-pm-add-definitions-for-s4-and-s5-states.patch asoc-sof-pm-add-explicit-behavior-for-acpi-s1-and-s2.patch --- diff --git a/queue-5.18/asoc-sof-intel-disable-imr-boot-when-resuming-from-acpi-s4-and-s5-states.patch b/queue-5.18/asoc-sof-intel-disable-imr-boot-when-resuming-from-acpi-s4-and-s5-states.patch new file mode 100644 index 00000000000..009d97d4801 --- /dev/null +++ b/queue-5.18/asoc-sof-intel-disable-imr-boot-when-resuming-from-acpi-s4-and-s5-states.patch @@ -0,0 +1,42 @@ +From 391153522d186f19a008d824bb3a05950351ce6c Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Thu, 16 Jun 2022 15:18:18 -0500 +Subject: ASoC: SOF: Intel: disable IMR boot when resuming from ACPI S4 and S5 states +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +commit 391153522d186f19a008d824bb3a05950351ce6c upstream. + +The IMR was assumed to be preserved when suspending to S4 and S5 +states, but community reports invalidate that assumption, the hardware +seems to be powered off and the IMR memory content cleared. + +Make sure regular boot with firmware download is used for S4 and S5. + +BugLink: https://github.com/thesofproject/sof/issues/5892 +Fixes: 5fb5f51185126 ("ASoC: SOF: Intel: hda-loader: add IMR restore support") +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Ranjani Sridharan +Reviewed-by: Péter Ujfalusi +Link: https://lore.kernel.org/r/20220616201818.130802-4-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/intel/hda-loader.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/sound/soc/sof/intel/hda-loader.c ++++ b/sound/soc/sof/intel/hda-loader.c +@@ -397,7 +397,8 @@ int hda_dsp_cl_boot_firmware(struct snd_ + struct firmware stripped_firmware; + int ret, ret1, i; + +- if ((sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT) && ++ if ((sdev->system_suspend_target < SOF_SUSPEND_S4) && ++ (sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT) && + !(sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT)) && + !sdev->first_boot) { + dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n"); diff --git a/queue-5.18/asoc-sof-pm-add-definitions-for-s4-and-s5-states.patch b/queue-5.18/asoc-sof-pm-add-definitions-for-s4-and-s5-states.patch new file mode 100644 index 00000000000..0a6531d5ee5 --- /dev/null +++ b/queue-5.18/asoc-sof-pm-add-definitions-for-s4-and-s5-states.patch @@ -0,0 +1,63 @@ +From 9d2d462713384538477703e68577b05131c7d97d Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Thu, 16 Jun 2022 15:18:17 -0500 +Subject: ASoC: SOF: pm: add definitions for S4 and S5 states +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +commit 9d2d462713384538477703e68577b05131c7d97d upstream. + +We currently don't have a means to differentiate between S3, S4 and +S5. Add definitions so that we have select different code paths +depending on the target state in follow-up patches. + +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Ranjani Sridharan +Reviewed-by: Péter Ujfalusi +Link: https://lore.kernel.org/r/20220616201818.130802-3-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/pm.c | 9 +++++++++ + sound/soc/sof/sof-priv.h | 2 ++ + 2 files changed, 11 insertions(+) + +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -23,6 +23,9 @@ static u32 snd_sof_dsp_power_target(stru + u32 target_dsp_state; + + switch (sdev->system_suspend_target) { ++ case SOF_SUSPEND_S5: ++ case SOF_SUSPEND_S4: ++ /* DSP should be in D3 if the system is suspending to S3+ */ + case SOF_SUSPEND_S3: + /* DSP should be in D3 if the system is suspending to S3 */ + target_dsp_state = SOF_DSP_PM_D3; +@@ -336,6 +339,12 @@ int snd_sof_prepare(struct device *dev) + case ACPI_STATE_S3: + sdev->system_suspend_target = SOF_SUSPEND_S3; + break; ++ case ACPI_STATE_S4: ++ sdev->system_suspend_target = SOF_SUSPEND_S4; ++ break; ++ case ACPI_STATE_S5: ++ sdev->system_suspend_target = SOF_SUSPEND_S5; ++ break; + default: + break; + } +--- a/sound/soc/sof/sof-priv.h ++++ b/sound/soc/sof/sof-priv.h +@@ -85,6 +85,8 @@ enum sof_system_suspend_state { + SOF_SUSPEND_NONE = 0, + SOF_SUSPEND_S0IX, + SOF_SUSPEND_S3, ++ SOF_SUSPEND_S4, ++ SOF_SUSPEND_S5, + }; + + enum sof_dfsentry_type { diff --git a/queue-5.18/asoc-sof-pm-add-explicit-behavior-for-acpi-s1-and-s2.patch b/queue-5.18/asoc-sof-pm-add-explicit-behavior-for-acpi-s1-and-s2.patch new file mode 100644 index 00000000000..6452f238621 --- /dev/null +++ b/queue-5.18/asoc-sof-pm-add-explicit-behavior-for-acpi-s1-and-s2.patch @@ -0,0 +1,48 @@ +From a933084558c61cac8c902d2474b39444d87fba46 Mon Sep 17 00:00:00 2001 +From: Pierre-Louis Bossart +Date: Thu, 16 Jun 2022 15:18:16 -0500 +Subject: ASoC: SOF: pm: add explicit behavior for ACPI S1 and S2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Pierre-Louis Bossart + +commit a933084558c61cac8c902d2474b39444d87fba46 upstream. + +The existing code only deals with S0 and S3, let's start adding S1 and S2. + +No functional change. + +Signed-off-by: Pierre-Louis Bossart +Reviewed-by: Ranjani Sridharan +Reviewed-by: Péter Ujfalusi +Link: https://lore.kernel.org/r/20220616201818.130802-2-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/sof/pm.c | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +--- a/sound/soc/sof/pm.c ++++ b/sound/soc/sof/pm.c +@@ -327,8 +327,18 @@ int snd_sof_prepare(struct device *dev) + return 0; + + #if defined(CONFIG_ACPI) +- if (acpi_target_system_state() == ACPI_STATE_S0) ++ switch (acpi_target_system_state()) { ++ case ACPI_STATE_S0: + sdev->system_suspend_target = SOF_SUSPEND_S0IX; ++ break; ++ case ACPI_STATE_S1: ++ case ACPI_STATE_S2: ++ case ACPI_STATE_S3: ++ sdev->system_suspend_target = SOF_SUSPEND_S3; ++ break; ++ default: ++ break; ++ } + #endif + + return 0; diff --git a/queue-5.18/series b/queue-5.18/series index ccbcacfec8d..802239fa3d4 100644 --- a/queue-5.18/series +++ b/queue-5.18/series @@ -152,3 +152,6 @@ exfat-use-updated-exfat_chain-directly-during-renaming.patch x86-amd-use-ibpb-for-firmware-calls.patch x86-alternative-report-missing-return-thunk-details.patch watchqueue-make-sure-to-serialize-wqueue-defunct-properly.patch +asoc-sof-pm-add-explicit-behavior-for-acpi-s1-and-s2.patch +asoc-sof-pm-add-definitions-for-s4-and-s5-states.patch +asoc-sof-intel-disable-imr-boot-when-resuming-from-acpi-s4-and-s5-states.patch