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

Check fw boot flags to load library #4643

Closed
wants to merge 2 commits into from
Closed
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
1 change: 1 addition & 0 deletions include/sound/sof/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define SOF_IPC_INFO_LOCKSV BIT(2)
#define SOF_IPC_INFO_GDB BIT(3)
#define SOF_IPC_INFO_D3_PERSISTENT BIT(4)
#define SOF_IPC_INFO_CONTEXT_SAVE BIT(5)

/* extended data types that can be appended onto end of sof_ipc_fw_ready */
enum sof_ipc_ext_data {
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/sof/intel/hda-loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ int hda_dsp_ipc4_load_library(struct snd_sof_dev *sdev,
struct snd_dma_buffer dmab;
int ret, ret1;

/* IMR booting will restore the libraries as well, skip the loading */
if (reload && hda->booted_from_imr)
/* if IMR booting and D3 context save are supported, skip the loading */
if (reload && hda->booted_from_imr && sdev->fw_ready.flags & SOF_IPC_INFO_CONTEXT_SAVE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is going to fail with reference firmware. FW_READY in IPC4 does not contain payload, thus the "fw_ready" is going to be all 0, the flag is 0 but the reference fw does have context save and the library re-load will fail since we are trying to load already loaded library.

Or do I miss something?

Copy link
Author

Choose a reason for hiding this comment

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

so what 's your advice ? I don't want to add more config in get_fw config which is also not compatible with reference fw.

return 0;

/* the fw_lib has been verified during loading, we can trust the validity here */
Expand Down