ipc4: use fixed-width types in ipc4_audio_fromat - #11126
Open
dbaluta wants to merge 1 commit into
Open
Conversation
struct ipc4_audio_format used bare enum members. On ARM EABI targets (e.g i.MX95 Cortex-M7) the toolchain defaults to -fshort-enums, which shrinks the enum-typed members. This makes host-supplied channels_count/valid_bit_depth be on the wrong offset. Fix this by using fixed uint32_t type instead of enums. Note that the same struct on the Linux kernel side uses uint32_t so this patch also aligns ipc4_audio_format structs on FW side / Host side. Signed-off-by; Daniel Baluta <daniel.baluta@nxp.com>
dbaluta
requested review from
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
August 25, 2026 12:12
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an IPC4 ABI layout hazard on targets that default to -fshort-enums (e.g., some ARM EABI toolchains) by ensuring struct ipc4_audio_format uses fixed-width 32-bit storage for fields that must match host-provided offsets, aligning the firmware-side definition with the Linux kernel’s uint32_t-based layout.
Changes:
- Replace enum-typed members in
struct ipc4_audio_formatwithuint32_tto prevent toolchain-dependent enum sizing from shifting subsequent fields. - Preserve intent/type meaning via inline comments indicating the corresponding enum for each now-
uint32_tfield.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kv2019i
approved these changes
Aug 25, 2026
kv2019i
left a comment
Collaborator
There was a problem hiding this comment.
Typo fromat in git commit, but otherwise looks good. Great to see more IPC4 targets coming up!
lgirdwood
approved these changes
Aug 25, 2026
lyakh
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
struct ipc4_audio_format used bare enum members. On ARM EABI targets (e.g i.MX95 Cortex-M7) the toolchain defaults to -fshort-enums, which shrinks the enum-typed members. This makes host-supplied channels_count/valid_bit_depth be on the wrong offset.
Fix this by using fixed uint32_t type instead of enums. Note that the same struct on the Linux kernel side uses uint32_t so this patch also aligns ipc4_audio_format structs on FW side / Host side.
This patch is the first one in a series preparing IPC4 support for IMX platforms.