Skip to content

Commit b11a610

Browse files
ujfalusibardliao
authored andcommitted
ASoC: SOF: Intel: hda: Power down DSP if it is left enabled in pre_fw_run()
It is expected that the DSP is in power down state when the firmware boot is attempted. If the DSP for any reason was left powered up then the DSP boot will fail since the ROM boot sequence might not be able to run. Make sure that the DSP is off before proceeding to boot it up. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent c1f47a8 commit b11a610

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

sound/soc/sof/intel/hda.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,20 @@ static inline void hda_dsp_sdw_process_mic_privacy(struct snd_sof_dev *sdev) { }
421421
/* pre fw run operations */
422422
int hda_dsp_pre_fw_run(struct snd_sof_dev *sdev)
423423
{
424+
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
425+
const struct sof_intel_dsp_desc *chip = hda->desc;
426+
int ret;
427+
428+
/* Power down DSP if left enabled to ensure a clean boot state. */
429+
if (hda_dsp_core_is_enabled(sdev, chip->host_managed_cores_mask)) {
430+
dev_dbg(sdev->dev, "DSP core enabled, power down DSP first\n");
431+
432+
ret = chip->power_down_dsp(sdev);
433+
if (ret < 0)
434+
dev_warn(sdev->dev,
435+
"%s: failed to power down already-enabled DSP\n", __func__);
436+
}
437+
424438
/* disable clock gating and power gating */
425439
return hda_dsp_ctrl_clock_power_gating(sdev, false);
426440
}

0 commit comments

Comments
 (0)