Skip to content

Commit 6f95eec

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: pm: Set target state earlier
If the DSP crashes before the system suspends, the setting of target state will be skipped because the firmware state will no longer be SOF_FW_BOOT_COMPLETE. This leads to the incorrect assumption that the DSP should suspend to D0I3 instead of suspending to D3. To fix this, set the target_state before we skip to DSP suspend even when the DSP has crashed. Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Curtis Malainey <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent a12a383 commit 6f95eec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sound/soc/sof/pm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
182182
const struct sof_ipc_pm_ops *pm_ops = sdev->ipc->ops->pm;
183183
const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
184184
pm_message_t pm_state;
185-
u32 target_state = 0;
185+
u32 target_state = snd_sof_dsp_power_target(sdev);
186186
int ret;
187187

188188
/* do nothing if dsp suspend callback is not set */
@@ -206,7 +206,6 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
206206
}
207207
}
208208

209-
target_state = snd_sof_dsp_power_target(sdev);
210209
pm_state.event = target_state;
211210

212211
/* Skip to platform-specific suspend if DSP is entering D0 */

0 commit comments

Comments
 (0)