ASoC: SOF: Intel: Power down DSP if it is left enabled in pre_fw_run()#5763
Open
ujfalusi wants to merge 2 commits intothesofproject:topic/sof-devfrom
Open
ASoC: SOF: Intel: Power down DSP if it is left enabled in pre_fw_run()#5763ujfalusi wants to merge 2 commits intothesofproject:topic/sof-devfrom
ujfalusi wants to merge 2 commits intothesofproject:topic/sof-devfrom
Conversation
…_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>
…_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>
There was a problem hiding this comment.
Pull request overview
This PR hardens the SOF Intel DSP boot flow by ensuring the DSP is powered down before attempting a firmware boot, preventing failures when the DSP is unexpectedly left in an enabled/powered state.
Changes:
- Add a Meteor Lake-specific “DSP enabled” check and power-down attempt in
mtl_dsp_pre_fw_run(). - Add a generic HDA pre-fw-run power-down attempt when DSP cores are already enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sound/soc/sof/intel/mtl.c | Adds a subsystem-enabled check and powers down DSP before proceeding with the normal pre-fw-run power-up sequence. |
| sound/soc/sof/intel/hda.c | Adds a pre-fw-run check to power down the DSP if host-managed cores appear enabled prior to disabling clock/power gating. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+239
to
+247
| static bool mtl_dsp_is_enabled(struct snd_sof_dev *sdev) | ||
| { | ||
| int val; | ||
|
|
||
| val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, MTL_HFDSSCS); | ||
| if (val & MTL_HFDSSCS_CPA_MASK) | ||
| return true; | ||
|
|
||
| return false; |
Comment on lines
+428
to
+433
| /* Power down DSP if left enabled to ensure a clean boot state. */ | ||
| if (hda_dsp_core_is_enabled(sdev, chip->host_managed_cores_mask)) { | ||
| dev_dbg(sdev->dev, "DSP core enabled, power down DSP first\n"); | ||
|
|
||
| ret = chip->power_down_dsp(sdev); | ||
| if (ret < 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.