Commit 57b06e97 authored by Mark Brown's avatar Mark Brown

ASoC: SOF: Intel: fix resume from hibernate

Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:

The enablement of IMR-based DSP boot helped reduce resume latency, but
unfortunately the context is not saved in S4 and S5 which leads to
multiple reports of boot failures.

This patchset forces a full firmware reload/reboot when resuming from
S4/S5 and restores functionality.
parents a37a9224 58ecb11e
...@@ -389,7 +389,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) ...@@ -389,7 +389,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
struct snd_dma_buffer dmab; struct snd_dma_buffer dmab;
int ret, ret1, i; int ret, ret1, i;
if (hda->imrboot_supported && !sdev->first_boot) { if (sdev->system_suspend_target < SOF_SUSPEND_S4 &&
hda->imrboot_supported && !sdev->first_boot) {
dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n"); dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
hda->boot_iteration = 0; hda->boot_iteration = 0;
ret = hda_dsp_boot_imr(sdev); ret = hda_dsp_boot_imr(sdev);
......
...@@ -23,6 +23,9 @@ static u32 snd_sof_dsp_power_target(struct snd_sof_dev *sdev) ...@@ -23,6 +23,9 @@ static u32 snd_sof_dsp_power_target(struct snd_sof_dev *sdev)
u32 target_dsp_state; u32 target_dsp_state;
switch (sdev->system_suspend_target) { 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: case SOF_SUSPEND_S3:
/* DSP should be in D3 if the system is suspending to S3 */ /* DSP should be in D3 if the system is suspending to S3 */
target_dsp_state = SOF_DSP_PM_D3; target_dsp_state = SOF_DSP_PM_D3;
...@@ -335,8 +338,24 @@ int snd_sof_prepare(struct device *dev) ...@@ -335,8 +338,24 @@ int snd_sof_prepare(struct device *dev)
return 0; return 0;
#if defined(CONFIG_ACPI) #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; 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;
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;
}
#endif #endif
return 0; return 0;
......
...@@ -85,6 +85,8 @@ enum sof_system_suspend_state { ...@@ -85,6 +85,8 @@ enum sof_system_suspend_state {
SOF_SUSPEND_NONE = 0, SOF_SUSPEND_NONE = 0,
SOF_SUSPEND_S0IX, SOF_SUSPEND_S0IX,
SOF_SUSPEND_S3, SOF_SUSPEND_S3,
SOF_SUSPEND_S4,
SOF_SUSPEND_S5,
}; };
enum sof_dfsentry_type { enum sof_dfsentry_type {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment