Skip to content

Commit

Permalink
ASoC: SOF: HDA: power down all DSP cores at suspend and remove
Browse files Browse the repository at this point in the history
Although the snd_sof_dsp_core_power_up/down will actually take effect on
the host managed DSP cores on Intel platforms, they are actually
designed for all DSP cores, and the enabled_cores_mask will update the
mask of those non host managed cores also.

In either hda_suspend() or hda_dsp_remove(), we should make sure all DSP
cores are power off and the enabled_cores_mask is reset to 0, so we
should call snd_sof_dsp_core_power_down() with mask of all cores, not
only the host_managed_cores_mask one.

Otherwise, those non host managed cores (e.g. core 1 on TigerLake) will
be preserved as 'enabled' in the enabled_cores_mask, in case those DSP
cores are 'ON' before _suspend() or_remove(). This misalignment will
lead to failure when we try to set up widgets or pipelines which rely
on those cores after resumed, as no _CORE_ENABLE IPC will be sent in
sof_core_enable() with enabled_cores_mask already cover it.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
  • Loading branch information
keyonjie committed Apr 27, 2021
1 parent 40bae94 commit 0369926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sound/soc/sof/intel/hda-dsp.c
Expand Up @@ -630,8 +630,8 @@ static int hda_suspend(struct snd_sof_dev *sdev, bool runtime_suspend)
snd_hdac_ext_bus_link_power_down_all(bus);
#endif

/* power down DSP */
ret = snd_sof_dsp_core_power_down(sdev, chip->host_managed_cores_mask);
/* power down all DSP cores */
ret = snd_sof_dsp_core_power_down(sdev, GENMASK(chip->cores_num - 1, 0));
if (ret < 0) {
dev_err(sdev->dev,
"error: failed to power down core during suspend\n");
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/sof/intel/hda.c
Expand Up @@ -980,9 +980,9 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL,
SOF_HDA_INT_CTRL_EN | SOF_HDA_INT_GLOBAL_EN, 0);

/* disable cores */
/* disable all cores */
if (chip)
snd_sof_dsp_core_power_down(sdev, chip->host_managed_cores_mask);
snd_sof_dsp_core_power_down(sdev, GENMASK(chip->cores_num - 1, 0));

/* disable DSP */
snd_sof_dsp_update_bits(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPCTL,
Expand Down

0 comments on commit 0369926

Please sign in to comment.