-
Notifications
You must be signed in to change notification settings - Fork 349
ext_manifest: define EMPTY with explicit 0 #3510
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
Conversation
src/include/kernel/ext_manifest.h
Outdated
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.
Still not following why we need a "last" ? Surely if one side does not know about an enum then we just ignore.
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.
@lgirdwood it is used to defien the fixed length array of the elems in the config data. It isnt really needed in the kernel as the kernel can determine the number of elements based on the hdr->size and the elem size.
/** EXT_MAN_ELEM_CONFIG_DATA elements (ABI3.17) */
struct ext_man_config_data {
struct ext_man_elem_header hdr;
struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM];
} __packed;
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.
@lgirdwood SOF firmware header need to define the array with LAST_ELEM. This is definitely required here.
We must keep same struct/enum for kernel header also, no? For practically kernel header don't need LAST_ELEM. I agree we(kernel driver) can calculate it by hdr->size and the elem size. I kept that in kernel header to match data structure with SOF fw side.
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 will constantly need updating unless it's set at MAX_INT or we use hdr->size * elem->size.
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.
@lgirdwood I defined MAX macro and removed LAST_ELEM. @ktrzcinx I chose 8 as initial MAX value for each extended manifest. Do you think 8 is good total number to start with?
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.
I don't like the idea of handling this as constant size array from kernel side - there's no reason for that, it can be easily handled as flex array so I don't see any pros of constant size array here, only a drawback of synchronising this value.
@fredoh9 how would you like to handle older FW with lower number of elements (older one) after introducing explicit dictionary capacity in kernel?
From FW side, explicit defining capacity instead using last enum value has some pros (explicit solution) and drawbacks (manual updating size) so I think it can be done here, but as long as we use each key once or none at all, I don't see need for it.
Explicit defining EXT_MAN_CONFIG_EMPTY is change in good direction.
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.
@ktrzcinx the only reason I'm moving to fixed size, there was concern about ABI change at every update. Kernel driver parses this with hdr information.
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.
I need only explicit EMPTY(0) to avoid waring at the moment. I can only add EMPTY=0 for this PR. I did diverse review unnecessarily.
9f28a79 to
6a9d39d
Compare
6a9d39d to
38193eb
Compare
Explicitly EMPTY is added as 0 for ext manifest config data. Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
lgirdwood
left a comment
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.
yes, it's defined in linker script and may be change to any other value if there will be such a need in the future. |
|
Is this still needed? |
|
No we don't need this any more. |
Explicitly EMPTY is added as 0 for ext manifest config data.
Signed-off-by: Fred Oh fred.oh@linux.intel.com
NO ABI change is required!
related issue: #3507
I will update linux pr thesofproject/linux#2297 shortly.