-
Notifications
You must be signed in to change notification settings - Fork 133
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
Conversation
a4ceaed
to
3e5f75e
Compare
3e5f75e
to
ad7573a
Compare
Kernel uses fw_ready information to get fw boot config. Signed-off-by: Rander Wang <[email protected]>
If fw supports both IMR booting and D3 context save, library reload can be skipped, or library should be reloaded. Signed-off-by: Rander Wang <[email protected]>
ad7573a
to
cbde678
Compare
update according to FW change. Get fw_ready info to check boot flags. thesofproject/sof#8342 |
/* 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@@ -599,6 +601,13 @@ static int ipc4_fw_ready(struct snd_sof_dev *sdev, struct sof_ipc4_msg *ipc4_msg | |||
sdev->debug_box.offset = snd_sof_dsp_get_window_offset(sdev, | |||
SOF_IPC4_DEBUG_WINDOW_IDX); | |||
|
|||
ret = snd_sof_dsp_block_read(sdev, SOF_FW_BLK_TYPE_SRAM, inbox_offset, fw_ready, | |||
sizeof(*fw_ready)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct sof_ipc_fw_ready
is the IPC3 fw_ready message. IPC4 does not define payload for FW_READY notification.
Reference fw definitely not giving any payload. The way to get the configuration and parameters is via GET_LARGE_CONFIG:FW_CONFIG, but that does not have a tuple defined for context save support as it is always supported in the reference fw along with IMR boot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ujfalusi why do we need to worry about the reference firmware in the context of library loading? Is this something we will ever test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only lose compatibility with a reference when all possible alternatives have been exhausted...
no need |
Follow IPC3 method to fw_ready flags and skip library reload if D3_PERSISTENT is supported.
FW PR: thesofproject/sof#8342