Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions include/sound/sof/ipc4/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ struct sof_ipc4_intel_mic_privacy_cap {
#define SOF_IPC4_LOG_CORE_GET(x) (((x) & SOF_IPC4_LOG_CORE_MASK) >> \
SOF_IPC4_LOG_CORE_SHIFT)

#define SOF_IPC4_FW_READY_LIB_RESTORED BIT(15)

/* Value of notification type field - must fit into 8 bits */
enum sof_ipc4_notification_type {
/* Phrase detected (notification from WoV module) */
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/sof/intel/hda-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,11 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev,
struct sof_ipc4_msg msg = {};
int ret, ret1;

/* if IMR booting is enabled and fw context is saved for D3 state, skip the loading */
if (reload && hda->booted_from_imr && ipc4_data->fw_context_save)
/*
* if IMR booting is enabled and libraries have been restored during fw
* boot, skip the loading
*/
if (reload && hda->booted_from_imr && ipc4_data->libraries_restored)
return 0;

/* the fw_lib has been verified during loading, we can trust the validity here */
Expand Down
6 changes: 6 additions & 0 deletions sound/soc/sof/ipc4-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ int sof_ipc4_query_fw_configuration(struct snd_sof_dev *sdev)
break;
case SOF_IPC4_FW_CONTEXT_SAVE:
ipc4_data->fw_context_save = *tuple->value;
/*
* Set the default libraries_restored value - if full
* context save is supported then it means that
* libraries are restored
*/
ipc4_data->libraries_restored = ipc4_data->fw_context_save;
break;
default:
break;
Expand Down
2 changes: 2 additions & 0 deletions sound/soc/sof/ipc4-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct sof_ipc4_fw_library {
* @max_libs_count: Maximum number of libraries support by the FW including the
* base firmware
* @fw_context_save: Firmware supports full context save and restore
* @libraries_restored: The libraries have been retained during firmware boot

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

bit: you mean restored during firmware boot?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes, just wanted to shuffle the terms a bit, should I use restored here as well?

*
* @load_library: Callback function for platform dependent library loading
* @pipeline_state_mutex: Mutex to protect pipeline triggers, ref counts, states and deletion
Expand All @@ -88,6 +89,7 @@ struct sof_ipc4_fw_data {
int max_num_pipelines;
u32 max_libs_count;
bool fw_context_save;
bool libraries_restored;

int (*load_library)(struct snd_sof_dev *sdev,
struct sof_ipc4_fw_library *fw_lib, bool reload);
Expand Down
14 changes: 12 additions & 2 deletions sound/soc/sof/ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,19 @@ EXPORT_SYMBOL(sof_ipc4_find_debug_slot_offset_by_type);

static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg)
{
/* no need to re-check version/ABI for subsequent boots */
if (!sdev->first_boot)
if (!sdev->first_boot) {
struct sof_ipc4_fw_data *ipc4_data = sdev->private;

/*
* After the initial boot only check if the libraries have been
* restored when full context save is not enabled
*/
if (!ipc4_data->fw_context_save)
ipc4_data->libraries_restored = !!(ipc4_msg->primary &
SOF_IPC4_FW_READY_LIB_RESTORED);

return 0;
}

sof_ipc4_create_exception_debugfs_node(sdev);

Expand Down
Loading