Skip to content

Commit

Permalink
ASoC: SOF: trace: release trace when suspending to D0i3
Browse files Browse the repository at this point in the history
Trace must be stopped when the DSP suspends to a D0
substate. Move the call to snd_sof_release_trace()
so that it can be released for all D0 substates and
add the call to re-init trace when resuming from a
low-power D0 substate.

Signed-off-by: Ranjani Sridharan <[email protected]>
  • Loading branch information
ranj063 committed Sep 18, 2021
1 parent 3bb2f4b commit 78a8ed4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions sound/soc/sof/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ static int sof_resume(struct device *dev, bool runtime_resume)
return ret;
}

/*
* Nothing further to be done for platforms that support the low power
* D0 substate.
*/
/* Only resume trace when resuming from low-power D0 substate */
if (!runtime_resume && sof_ops(sdev)->set_power_state &&
old_state == SOF_DSP_PM_D0)
old_state == SOF_DSP_PM_D0) {
/* this is not fatal */
ret = snd_sof_init_trace_ipc(sdev);
if (ret < 0)
dev_warn(sdev->dev, "failed to init trace after resume %d\n", ret);

return 0;
}

sdev->fw_state = SOF_FW_BOOT_PREPARE;

Expand Down Expand Up @@ -204,15 +207,15 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)

target_state = snd_sof_dsp_power_target(sdev);

/* release trace */
snd_sof_release_trace(sdev);

/* Skip to platform-specific suspend if DSP is entering D0 */
if (target_state == SOF_DSP_PM_D0)
goto suspend;

sof_tear_down_pipelines(sdev, false);

/* release trace */
snd_sof_release_trace(sdev);

#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_DEBUGFS_CACHE)
/* cache debugfs contents during runtime suspend */
if (runtime_suspend)
Expand Down

0 comments on commit 78a8ed4

Please sign in to comment.