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

basefw: add support for fw config query for context save #8428

Merged
merged 2 commits into from
Nov 24, 2023

Conversation

RanderWang
Copy link
Collaborator

@RanderWang RanderWang commented Nov 1, 2023

If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report fw_context_save is supported to host

kernel pr: thesofproject/linux#4680

src/audio/base_fw.c Outdated Show resolved Hide resolved
@RanderWang
Copy link
Collaborator Author

on kernel side, I change the default value of fw_context_save on TGL & MTL to ture, unless fw overrides it

Copy link
Contributor

@btian1 btian1 left a comment

Choose a reason for hiding this comment

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

just a suggestion in comments:
If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report
fw_context_save is supported to driver. Driver will assume fw doesn't
support this feature if it is not reported.

@ujfalusi
Copy link
Contributor

ujfalusi commented Nov 2, 2023

just a suggestion in comments: If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report fw_context_save is supported to driver. Driver will assume fw doesn't support this feature if it is not reported.

The assumption is that the context save is supported if IMR is supported. We need negative flagging for this.

src/audio/base_fw.c Outdated Show resolved Hide resolved
@RanderWang
Copy link
Collaborator Author

just a suggestion in comments: If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report fw_context_save is supported to driver. Driver will assume fw doesn't support this feature if it is not reported.

The assumption is that the context save is supported if IMR is supported. We need negative flagging for this.

@ujfalusi how about ID now ? We don't need negative flag sine the default value in kernel is true, not false.

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

Just need to align new IDs

/* Max config parameter id */
IPC4_MAX_FW_CFG_PARAM = IPC4_FW_CFG_PARAMS_COUNT - 1,
IPC4_MAX_FW_CFG_PARAM = IPC4_FW_CONTEXT_SAVE - 1,
Copy link
Member

Choose a reason for hiding this comment

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

@RanderWang @ujfalusi @mwasko @marcinszkudlinski to be on the safe side - can we add our new Intel reserved IDs as part of this PR and I think its going to be better if we also assign the numbers when updating this enum. i.e there is no ambiguos enum, developers should always see

IPC4_SOME_ENUM = NUMBER,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea! I use 100, big enough for 10 years.

Copy link
Member

Choose a reason for hiding this comment

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

good idea! I use 100, big enough for 10 years.

be careful, our industry has a bad experinces with quotes like these ;)

@RanderWang RanderWang force-pushed the lib_reload_config branch 2 times, most recently from 456d157 to 1ff2579 Compare November 6, 2023 06:13
@RanderWang
Copy link
Collaborator Author

reserve 100 for this config

@RanderWang
Copy link
Collaborator Author

@lgirdwood sync latest config from ref fw.

@RanderWang RanderWang force-pushed the lib_reload_config branch 2 times, most recently from 6b78836 to ffb1746 Compare November 13, 2023 09:08
@RanderWang
Copy link
Collaborator Author

@lgirdwood I reserved 3 id, how about it ? Thanks!

src/include/ipc4/base_fw.h Show resolved Hide resolved
/* Intel reserved */
IPC4_INTEL_RESRVED_29 = 29,
IPC4_INTEL_RESRVED_30 = 30,
IPC4_INTEL_RESRVED_31 = 31,
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 are using 31 we can name it using its real name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

@RanderWang
Copy link
Collaborator Author

@lgirdwood update the ID name

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

@mwasko this PR also reserves the in-use IDs until some process is created to align.

@lgirdwood
Copy link
Member

@ujfalusi pls review, does kernel align or does it require a similar PR ?

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

A few comments on the code documentation, otherwise looks good.

src/include/ipc4/base_fw.h Outdated Show resolved Hide resolved
src/include/ipc4/base_fw.h Outdated Show resolved Hide resolved
Update the basefw config query.

Signed-off-by: Rander Wang <[email protected]>
@RanderWang RanderWang force-pushed the lib_reload_config branch 2 times, most recently from a603a93 to c488070 Compare November 15, 2023 01:22
@lgirdwood
Copy link
Member

@wszypelt @lrudyX not expecting an ID update to break, good to merge ? Thanks !

@lgirdwood lgirdwood added this to the v2.8 milestone Nov 17, 2023
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

@mwasko @mmaka1 good to go (this reserves 29 for the new cfg id)?

@kv2019i
Copy link
Collaborator

kv2019i commented Nov 20, 2023

@RanderWang can you check the CI (and/or repush if this is transient as probably is the case)?

@RanderWang
Copy link
Collaborator Author

SOFCI TEST

@RanderWang
Copy link
Collaborator Author

Will update it according to ref fw which has merged a config

If CONFIG_ADSP_IMR_CONTEXT_SAVE is enabled, base fw will report
fw_context_save is supported to host. Driver will assume fw doesn't
support this feature if it is not reported.

Signed-off-by: Rander Wang <[email protected]>
@RanderWang
Copy link
Collaborator Author

@kv2019i
Copy link
Collaborator

kv2019i commented Nov 24, 2023

SOFCI TEST

@lgirdwood lgirdwood merged commit 472458e into thesofproject:main Nov 24, 2023
38 checks passed
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.

8 participants