Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASoC: SOF: Intel: hda: Create debugfs file to force a clean DSP boot #4738

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <sound/hda_register.h>

#include <linux/acpi.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_intel.h>
Expand Down Expand Up @@ -376,8 +377,12 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev)
/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT) &&
(sdev->fw_ready.flags & SOF_IPC_INFO_D3_PERSISTENT ||
sdev->pdata->ipc_type == SOF_IPC_TYPE_4))
sdev->pdata->ipc_type == SOF_IPC_TYPE_4)) {
hdev->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hdev->skip_imr_boot);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not call is 'skip_imr_boot' then? I find 'cold-boot' confusing because we run this code path during reboot aka warm boot...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also have a post_fw_run in mtl.c and lnl.c!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other name that came up was request_dsp_cold_boot to imply that it is only for the next DSP boot.
I'm fine naming it skip_imr_boot though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option has a slight flaw and would work only to skip IMR boot for the second iteration of FW boot after the value is written isnt it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ranj063, it will skip the IMR boot at the next DSP boot.
If the DSP was off then the next boot will be a 'clean' boot.
If the DSP was not off then it needs to be power cycled.

}

hda_sdw_int_enable(sdev, true);
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/sof/intel/lnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Hardware interface for audio DSP on LunarLake.
*/

#include <linux/debugfs.h>
#include <linux/firmware.h>
#include <sound/hda_i915.h>
#include <sound/hda_register.h>
Expand Down Expand Up @@ -89,8 +90,12 @@ static int lnl_dsp_post_fw_run(struct snd_sof_dev *sdev)
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;

/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT))
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT)) {
hda->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hda->skip_imr_boot);
}
}

return 0;
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/sof/intel/mtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Hardware interface for audio DSP on Meteorlake.
*/

#include <linux/debugfs.h>
#include <linux/firmware.h>
#include <sound/sof/ipc4/header.h>
#include <trace/events/sof_intel.h>
Expand Down Expand Up @@ -299,8 +300,12 @@ int mtl_dsp_post_fw_run(struct snd_sof_dev *sdev)
}

/* Check if IMR boot is usable */
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT))
if (!sof_debug_check_flag(SOF_DBG_IGNORE_D3_PERSISTENT)) {
hdev->imrboot_supported = true;
debugfs_create_bool("skip_imr_boot",
0644, sdev->debugfs_root,
&hdev->skip_imr_boot);
}
}

hda_sdw_int_enable(sdev, true);
Expand Down