diff options
author | Libin Yang <libin.yang@intel.com> | 2022-03-30 23:19:22 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-04 10:39:07 +0300 |
commit | 249ee180874dd48a809caf70981b2aa800329d27 (patch) | |
tree | 417e6b0649d011c009b2a92eda3b7e30aeab5745 /sound/soc/sof/pm.c | |
parent | 758f24d49bff2707812fb8dfac53930603e26312 (diff) | |
download | linux-249ee180874dd48a809caf70981b2aa800329d27.tar.xz |
ASoC: SOF: disable dma trace in s0ix
When system enters s0ix, the dma trace won't be used. Otherwise,
the DMA will access the host memory, which will prevent entering
S0ix. Driver has notified firmware not to send message through
dma trace. Let's also trigger stop dma trace in driver side.
Signed-off-by: Libin Yang <libin.yang@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220330201926.1330402-8-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/pm.c')
-rw-r--r-- | sound/soc/sof/pm.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c index a1a645a13c6d..44008dd075c2 100644 --- a/sound/soc/sof/pm.c +++ b/sound/soc/sof/pm.c @@ -102,11 +102,18 @@ static int sof_resume(struct device *dev, bool runtime_resume) /* * Nothing further to be done for platforms that support the low power - * D0 substate. + * D0 substate. Resume trace and return 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) { + ret = snd_sof_trace_resume(sdev); + if (ret < 0) + /* non fatal */ + dev_warn(sdev->dev, + "failed to enable trace after resume %d\n", ret); return 0; + } sof_set_fw_state(sdev, SOF_FW_BOOT_PREPARE); @@ -201,6 +208,7 @@ static int sof_suspend(struct device *dev, bool runtime_suspend) /* Skip to platform-specific suspend if DSP is entering D0 */ if (target_state == SOF_DSP_PM_D0) { + snd_sof_trace_suspend(sdev, pm_state); /* Notify clients not managed by pm framework about core suspend */ sof_suspend_clients(sdev, pm_state); goto suspend; |