Skip to content

[BUG] ext manifest has extra element #3507

@fredoh9

Description

@fredoh9

Describe the bug
Working on thesofproject/linux#2297.
Parsing CAVS EXT MANIFEST, it is supposed to parse total 3 elems from ext_man_cavs_config_data but total 5 of elems are parsed. There are unnecessary extra elems. It causes warnings.

Should EXT_MAN_CAVS_CONFIG_LAST_ELEM be up to date with last element? like below?

/* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements identificators */
enum cavs_config_elem_type {
	EXT_MAN_CAVS_CONFIG_LPRO	= 1,
	EXT_MAN_CAVS_CONFIG_OUTBOX_SIZE,
	EXT_MAN_CAVS_CONFIG_INBOX_SIZE,
	EXT_MAN_CAVS_CONFIG_LAST_ELEM = EXT_MAN_CAVS_CONFIG_INBOX_SIZE,	/**< keep up to date with last element */
};

/* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements */
struct ext_man_cavs_config_data {
	struct ext_man_elem_header hdr;

	struct config_elem elems[EXT_MAN_CAVS_CONFIG_LAST_ELEM];
} __packed;

And even with this fix, first 0 is unavoidable. as we start from 1. (short log is below) one warning is always printed in kernel side.
Kernel folks are very picky about unnecessary warnings. Any suggestion about this also?

How about define uninitialized elem_type,
EXT_MAN_CAVS_CONFIG_UNINIT = 0,

To Reproduce
Need to test with thesofproject/linux#2297.

Reproduction Rate
100%

Expected behavior
Only 3 elements are parsed

Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)

Environment
SOF main branch + #2957 and linux pr 2297

Screenshots or console output

[    1.582426] sof-audio-pci 0000:00:1f.3: hdr->type: 6, hdr->size = 48, elem_num=5
[    1.582428] sof-audio-pci 0000:00:1f.3: FW clock config: LPRO
[    1.582430] sof-audio-pci 0000:00:1f.3: unsupported token type: 2 value=4096
[    1.582431] sof-audio-pci 0000:00:1f.3: unsupported token type: 3 value=8192
[    1.582433] sof-audio-pci 0000:00:1f.3: unsupported token type: 0 value=0
[    1.582434] sof-audio-pci 0000:00:1f.3: unsupported token type: 0 value=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expectedstaleIssue/PR marked as stale and will be closed after 14 days if there is no activity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions