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

ipc4: set fw_ready flag for host #8342

Closed
wants to merge 1 commit into from

Conversation

RanderWang
Copy link
Collaborator

@RanderWang RanderWang commented Oct 18, 2023

Set SOF_IPC_INFO_FW_CONTEXT_SAVE for fw_ready event to
host if IMR_CONTEXT_SAVE is supported so that host can sync up with
FW, .e.g. avoid library reload if IMR_CONTEXT_SAVE is supported.

Currently CAVS platforms don't support IMR_CONTEXT_SAVE but ACE
platforms support it. It doesn't affect windows driver since the
fw_ready data is not used by it.

kernel PR: thesofproject/linux#4643

src/ipc/ipc4/handler.c Outdated Show resolved Hide resolved
src/ipc/ipc4/handler.c Outdated Show resolved Hide resolved
@RanderWang RanderWang force-pushed the lib_reload branch 2 times, most recently from 2c46361 to abfcab8 Compare October 20, 2023 01:46
@RanderWang RanderWang requested a review from a team as a code owner October 20, 2023 01:46
@RanderWang
Copy link
Collaborator Author

update flags only, thanks

Set SOF_IPC_INFO_CONTEXT_SAVE for fw_ready event to
host if IMR_CONTEXT_SAVE is supported so that host can sync up with
FW, .e.g. avoid library reload if IMR_CONTEXT_SAVE is supported.

Currently CAVS platforms don't support IMR_CONTEXT_SAVE but ACE
platforms support it. It doesn't affect windows driver since the
fw_ready data is not used by it.

Signed-off-by: Rander Wang <[email protected]>
#if CONFIG_CAVS_IMR_D3_PERSISTENT && CONFIG_ADSP_IMR_CONTEXT_SAVE
.flags = DEBUG_SET_FW_READY_FLAGS | SOF_IPC_INFO_D3_PERSISTENT |
SOF_IPC_INFO_CONTEXT_SAVE,
#elif CONFIG_CAVS_IMR_D3_PERSISTENT
Copy link
Contributor

Choose a reason for hiding this comment

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

We are not reading the IPC3 sof_ipc_fw_ready message from mailbox in case of IPC4.
Reference firmware do not passes any information via mailbox for FW_READY, iow IPC4 does not define payload for FW_READY.

Copy link
Member

Choose a reason for hiding this comment

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

If we need out of manifest flags at boot (based on important Kconfig selections) then we need to add them.

Copy link
Contributor

Choose a reason for hiding this comment

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

The IPC4 way of fw configuration query is via LAGE_CONFIG_GET:FW_CONFIG message. It has definition for various firmware parameters as tlv tuple bundle.
The reference IPC4 FW_READY notification does not have payload and I think if we want to keep the IPC4 name we should not introduce incompatible changes to the basic and common messages, notifications.

Copy link
Member

Choose a reason for hiding this comment

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

IPC4 is not immutable, it needs to be backwards compatible but grow as features and needs arise.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree. An IPC3 (SOF specific) message in the mailbox as payload for IPC4 FW_READY notification is not going to be backwards compatible with the reference, it is not going to be compatible at all since the reference is not placing anything in the mailbox for FW_READY, especially it is not going to place an IPC3 message in there which is part of the IPC3 protocol - in a similar way that IPC4 FW_READY does not have payload.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ujfalusi why we can't development IPC4 without breaking windows driver ? And if we are stick to current IPC4, we can't use LAGE_CONFIG_GET:FW_CONFIG since it doesn't support this query and we can't add more config, right ?

Copy link
Member

Choose a reason for hiding this comment

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

@RanderWang I think direction now is to take this flag as a manifest flag. We should make it clear and add a comment to the FW ready message that the fields in FW ready should only be for runtime generated information (i.e. build time information would go in the manifest). Thanks !

.flags = DEBUG_SET_FW_READY_FLAGS,
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

should line 59-61 will be removed, since this is ace/platform.c, it should support CONTEXT_SAVE?

#if CONFIG_CAVS_IMR_D3_PERSISTENT && CONFIG_ADSP_IMR_CONTEXT_SAVE
.flags = DEBUG_SET_FW_READY_FLAGS | SOF_IPC_INFO_D3_PERSISTENT |
SOF_IPC_INFO_CONTEXT_SAVE,
#elif CONFIG_CAVS_IMR_D3_PERSISTENT
.flags = DEBUG_SET_FW_READY_FLAGS | SOF_IPC_INFO_D3_PERSISTENT,
#else
Copy link
Contributor

Choose a reason for hiding this comment

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

can we change code from 70 --> 76 like below to avoid repeated code?

.flags = DEBUG_SET_FW_READY_FLAGS,

#if CONFIG_CAVS_IMR_D3_PERSISTENT
.flags |= SOF_IPC_INFO_D3_PERSISTENT,
#endif
#if CONFIG_ADSP_IMR_CONTEXT_SAVE
.flags |= SOF_IPC_INFO_CONTEXT_SAVE,
#endif

@RanderWang
Copy link
Collaborator Author

no need

@RanderWang RanderWang closed this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants