Skip to content

Conversation

@fredoh9
Copy link
Contributor

@fredoh9 fredoh9 commented Oct 9, 2020

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.

Copy link
Member

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.

Copy link
Collaborator

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;

Copy link
Contributor Author

@fredoh9 fredoh9 Oct 12, 2020

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.

Copy link
Member

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.

Copy link
Contributor Author

@fredoh9 fredoh9 Oct 15, 2020

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?

Copy link
Member

@ktrzcinx ktrzcinx Oct 15, 2020

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

@fredoh9 fredoh9 Oct 15, 2020

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.

@fredoh9 fredoh9 force-pushed the fix/ext_empty_and_last branch 2 times, most recently from 9f28a79 to 6a9d39d Compare October 15, 2020 00:53
@fredoh9 fredoh9 requested a review from lgirdwood October 15, 2020 03:24
@fredoh9 fredoh9 force-pushed the fix/ext_empty_and_last branch from 6a9d39d to 38193eb Compare October 15, 2020 16:16
@fredoh9 fredoh9 changed the title ext_manifest: add empty enum and update LAST_ELEM with last value ext_manifest: define EMPTY with explicit 0 Oct 15, 2020
Explicitly EMPTY is added as 0 for ext manifest config data.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
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.

@ktrzcinx @fredoh9 just to confirm any trailing space after this table is 0 (meaning legacy works). @kv2019i how has the kernel dealt with this in the past, is this solution backwards compatible for you ?

@ktrzcinx
Copy link
Member

ktrzcinx commented Oct 22, 2020

@ktrzcinx @fredoh9 just to confirm any trailing space after this table is 0 (meaning legacy works)

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.
Example:

xt-objdump -sj ".fw_metadata" ./src/arch/xtensa/sof-cnl
...
 22000190 00000000 00000000 dec0dec0 ffeedec0  ................
 220001a0 06000000 30000000 02000000 00100000  ....0...........   <- Extended manifest found module, type: 0x0006 size: 0x0030 (  48) 
 220001b0 03000000 00200000 00000000 00000000  ..... ..........
 220001c0 00000000 00000000 dec0dec0 ffeedec0  ................
 220001d0 00000000 50000000 3c000000 01000500  ....P...<.......   <- Extended manifest found module, type: 0x0000 size: 0x0050 (  80)
...

@lgirdwood lgirdwood closed this Mar 28, 2021
@lgirdwood lgirdwood deleted the branch thesofproject:master March 28, 2021 13:44
@paulstelian97
Copy link
Collaborator

Is this still needed?

@fredoh9
Copy link
Contributor Author

fredoh9 commented Mar 29, 2021

No we don't need this any more.

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.

5 participants