Skip to content

zephyr: fix gtw config size on D3 resume#10633

Open
wjablon1 wants to merge 2 commits intothesofproject:mainfrom
wjablon1:gtw_cfg_size_fix
Open

zephyr: fix gtw config size on D3 resume#10633
wjablon1 wants to merge 2 commits intothesofproject:mainfrom
wjablon1:gtw_cfg_size_fix

Conversation

@wjablon1
Copy link
Contributor

@wjablon1 wjablon1 commented Mar 19, 2026

I discovered these two issues while playing with AI:

  1. This one is my obvious mistake and has to be fixed: zephyr: fix gtw config size on D3 resume
  2. This is just robustness improvement (not that critical): dai-zephyr: fix config nuances

@wjablon1 wjablon1 requested a review from tmleman as a code owner March 19, 2026 15:25
Copilot AI review requested due to automatic review settings March 19, 2026 15:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Zephyr DAI resume/config handling to ensure correct configuration sizing across D3 resume and to improve robustness when applying DAI configuration blobs vs structured IPC configs.

Changes:

  • Fix D3 resume path to pass gateway config size in bytes (not words) into dai_set_config().
  • Introduce SOF_DAI_CONFIG_HW_SPEC_OFFSET to separate common vs HW-specific portions of sof_ipc_dai_config.
  • Adjust Zephyr DAI config setup to better handle config blobs and to pass only HW-specific payload size to dai_config_set() for non-blob configs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
zephyr/lib/cpu.c Fixes DAI resume to compute the gateway config byte size before reapplying config after D3.
src/include/ipc/dai.h Adds a macro for the offset to HW-specific config data within sof_ipc_dai_config.
src/audio/dai-zephyr.c Updates Zephyr DAI config path to use common config fields and adjust payload size passed to Zephyr dai_config_set().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Good fixes.

Convert length of DAI gtw cfg from words to bytes before passing it to
dai_set_config() during D3 resume. The same conversion is already
performed during the initial configuration.

Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
If a DAI config is passed as a blob (IPC4 case) to dai_set_config,
it cannot be cast to sof_ipc_dai_config because the blob format might
differ. This commit fixes this by using the format field of ipc_config_dai
instead. Field options is set to 0 for the blob case.

Additionally, this commit trims the size of a bespoke config for non-blob
case after removing the common header.

Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
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.

3 participants