-
Notifications
You must be signed in to change notification settings - Fork 311
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
UUID Firmware support #2920
UUID Firmware support #2920
Conversation
the corresponding tplg PR: #2919 |
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.
Please do the generic process comp type first. It should be usptream before any other patches are merged.
This is ready for review now. @lgirdwood @kv2019i @mmaka1 @ktrzcinx |
src/audio/component.c
Outdated
if (!rstrncmp((const char *)info->drv->uid, | ||
(const char *)uuid, UUID_SIZE)) { | ||
tr_info(&comp_tr, | ||
"get_drv_from_uuid(), found driver type %d, uuid %s", | ||
info->drv->type, info->drv->uid); |
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.
There is some mismatch - UUID_SIZE is equal to 16, what is binary UUID number size, so it should be compared with memcmp
and printing this value can't be done with %s
, or when UUID should be passed in text form, then drv->uid size is too small.
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.
The uuid is passed in binary mode for the comparing, the printing here is for the full text(including the naming).
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.
why are we comparing strings ? I would expect us to compare the binary a.b.c.d data/struct
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.
changed now.
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.
src/include/ipc/topology.h
Outdated
@@ -64,6 +64,7 @@ struct sof_ipc_comp { | |||
enum sof_comp_type type; | |||
uint32_t pipeline_id; | |||
uint32_t core; | |||
uint8_t uuid[16]; /**< 16 Bytes UUID of the component */ |
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.
can we use the same a.b.c.d structure that @mmaka1 has already defined. This will need to be a new IPC struct too.
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.
Andy from the kernel side suggest not to use uuid_t or guid_t struct as ABI, see here: thesofproject/linux#2090 (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.
use the FW structure here exactly.
src/audio/component.c
Outdated
if (!rstrncmp((const char *)info->drv->uid, | ||
(const char *)uuid, UUID_SIZE)) { | ||
tr_info(&comp_tr, | ||
"get_drv_from_uuid(), found driver type %d, uuid %s", | ||
info->drv->type, info->drv->uid); |
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.
why are we comparing strings ? I would expect us to compare the binary a.b.c.d data/struct
@lgirdwood It's in byte(or binary, not a(4B)/b(2B)/c(2B)/d(B * 8)) from the driver, so we are comparing bytes here actually. |
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.
@@ -464,6 +460,11 @@ SECTIONS | |||
KEEP (*(.fw_ready_metadata)) | |||
} >sof_fw :sof_fw_phdr | |||
|
|||
.static_uuid_entries : ALIGN(4) |
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.
Is this the same change that @ktrzcinx has just submitted ? Can you guys align.
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.
No, this one is about .static_uuid_entries
, I've made PR for .trace_ctx
section.
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.
ok, so we have any dependencies for merging ?
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 think so
src/include/ipc/topology.h
Outdated
@@ -64,6 +64,7 @@ struct sof_ipc_comp { | |||
enum sof_comp_type type; | |||
uint32_t pipeline_id; | |||
uint32_t core; | |||
uint8_t uuid[16]; /**< 16 Bytes UUID of the component */ |
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.
use the FW structure here exactly.
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.
Implementation needs some iteration, but main principles seem right.
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 think extended_data_length
is a good trade-off between backward compatibility, protocol simplicity and code clarity, thanks! I think the sanity check ("validation" sounds a bit pretentious) can be both clearer and stricter, see below.
src/audio/component.c
Outdated
|
||
/* validate the hdr.size */ | ||
if (comp->hdr.size < comp->ext_data_length) { | ||
tr_err(&comp_tr, "Invalid size, hdr.size:0x%x, ext_data_length:0x%x\n", |
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.
Assuming I got this right, replace with:
// Basic sanity check of total length and extended data length.
// In this generic code we don't know which specific comp and how much it adds
if (comp->hdr.size < sizeof(sof_ipc_comp) + comp->ext_data_length) {
- stricter so catches more errors
- makes it clearer that
hdr.size
is actuallyhdr.total_size
without changing its name.
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.
ack - with C style comments.
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.
@marc-hb, this is not included in your fixup commits?
src/include/ipc/header.h
Outdated
@@ -86,10 +86,12 @@ | |||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
* | Core | | |||
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |||
* | Reserved | | |||
* | ext_data_length | |
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 doubt ext_data_length
will ever need 32bits / 4GB, will it? If not then some bits should be kept reserved.
PS: thanks to little-endianness these bits could easily be reserved again even after this gets merged.
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.
Lets use full extended size - anything new here will be added to extended data and this keeps it simple prior to IPC2.0
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.
@marc-hb I agree with Liam. 32bit fields are faster to parse on the DSP and if we need to add something more, we now have the extended data defined, so you can add any new fields at end of extended data.
I shared 2-3 fixup! commits at https://github.com/marc-hb/sof/commits/uuid-2020-07-21 |
Thank you @marc-hb, these all look good. @keyonjie can you squash these into the PR. |
In these fixups I removed the word "new" from |
Sure. I prefer to rename the sof_ipc_comp_ext_data to sof_ipc_comp_ext to avoid too long naming, is that sounds good for you @liam and @marc? |
Doesn't make much difference to me. It's still too long.
…On Wed, 22 Jul 2020, 05:25 Keyon Jie, ***@***.***> wrote:
I shared 2-3 fixup! commits at
https://github.com/marc-hb/sof/commits/uuid-2020-07-21
Thank you @marc-hb <https://github.com/marc-hb>, these all look good.
@keyonjie <https://github.com/keyonjie> can you squash these into the PR.
Sure. I prefer to rename the sof_ipc_comp_ext_data to sof_ipc_comp_ext to
avoid too long naming, is that sounds good for you @liam
<https://github.com/liam> and @marc <https://github.com/marc>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2920 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAGRFHYNUT2GRVBQZRTYEDR4ZS4BANCNFSM4M4UDAEA>
.
|
OK, let me squashing and updating them now. @marc-hb for the documentation update, I would prefer to keep the name of each member and add the corresponding explain to the subsequent '()', which will be easier for understanding while reading document with the struct definition header file together. |
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.
@plbossart @ranj063 @keyonjie how is the kernel side looking ?
CI bat sounds fine at 997. |
The kernel side is also updated and aligned with FW, @plbossart @ranj063 can you help to review as @kv2019i won't be available in the coming 2 weeks? |
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 prefer to rename the sof_ipc_comp_ext_data to sof_ipc_comp_ext to avoid too long naming, is that sounds good for you @liam and @marc?
Either is fine by me. Just for the record sof_ipc_comp_ext_data
was only one character longer than the original sof_ipc_comp_new_ext
! :-)
It's still too long.
C lacks namespaces.
@marc-hb for the documentation update, I would prefer to keep the name of each member and add the corresponding explain to the subsequent '()',
While this should certainly not hold back this PR, I disagree and for at least for IPC2.0 let me explain why. The purpose of the protocol documentation is to take a bit of distance with respect to the too short or too long C-symbol-of-the-day or other implementation details and use plain English instead to describe and focus on the protocol design, on the corresponding high level logic and on any corner cases. This is how @kv2019i started this document and the ext_data_length
symbol you're adding is inconsistent with all the other lines in the same table.
which will be easier for understanding while reading document with the struct definition header file together.
In general, if someone finds it difficult to match the protocol description in plain English with the code when they are side by side (even though the fields are in the exact same order!) then it means there is a much bigger problem: either the English is really bad, or the symbol names are bad, or they both are.
In this particular case I can't imagine anyone struggling to match the "Extended Data Size" in English with extended_data_length
in the code.
Hello, please remove me from this mailing list. Thanks,
Liam
…On Thu, 23 Jul 2020, 02:37 Marc, ***@***.***> wrote:
***@***.**** approved this pull request.
I prefer to rename the sof_ipc_comp_ext_data to sof_ipc_comp_ext to avoid
too long naming, is that sounds good for you @liam
<https://github.com/liam> and @marc <https://github.com/marc>?
Either is fine by me. Just for the record sof_ipc_comp_ext_data was only
one character longer than the original sof_ipc_comp_new_ext! :-)
It's still too long.
C lacks namespaces.
@marc-hb <https://github.com/marc-hb> for the documentation update, I
would prefer to keep the name of each member and add the corresponding
explain to the subsequent '()',
While this should certainly not hold back this PR, I disagree and for at
least for IPC2.0 let me explain why. The purpose of the protocol
documentation is to take a bit of distance with respect to the too short or
too long C-symbol-of-the-day or other implementation details and use plain
English instead to describe and focus on the protocol design, on the
corresponding high level logic and on any corner cases. This is how
@kv2019i <https://github.com/kv2019i> started this document and the
ext_data_length symbol you're adding is inconsistent with all the other
lines in the same table.
which will be easier for understanding while reading document with the
struct definition header file together.
In general, if someone finds it difficult to match the protocol
description in plain English with the code when they are side by side (even
though the fields are in the exact same order!) then it means there is a
much bigger problem: either the English is really bad, or the symbol names
are bad, or they both are.
In this particular case I can't imagine anyone struggling to match the
"Extended Data Size" in English with extended_data_length in the code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2920 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAGRFH6ULCPRU5WDKQ3IO3R46H6RANCNFSM4M4UDAEA>
.
|
@liam apologies, you can unsubscribe yourself using the web view and clicking "unsubscribe" near the bottom of the right hand menu |
Initial the struct sof_ipc_comp_file to make sure all no updated flags are 0s. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Initial the definition of struct sof_ipc_comp_new_ext, which will be used to align the extended data between FW and the SW, add UUID array to it. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Use the 32bit reserved member of the struct sof_ipc_comp as the extended data length, this will help to minimize the ABI change for adding new extended data to the struct sof_ipc_comp, usually only minor ABI version bump needed for every update with this new solution. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add function memcmp for comparing two length-limited memory. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Switch to use UUID for component creation, if it is provided from the host, otherwise, use component type for the component driver matching. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Update the IPC protocol documentation to include the extended data. Signed-off-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
SOFCI |
Will apply after CI completes now that we have both FW and kernel dev approvals. |
Internal CI showing all green on build and scheduler tests. Jenkins showing unrelated alsabat failure. @zrombel I assume internal CI is good to merge ? |
@lgirdwood yes, from internal CI view, PR is good to go. |
This is the Firmware part series for UUID support, it should be used together with the tplg part and kernel part.