Skip to content

Fix IPC4 EXTENDED_SYSTEM_TIME handling in SOF - #11612

Open
gjanca wants to merge 2 commits into
thesofproject:mainfrom
gjanca:ext_time
Open

gjanca wants to merge 2 commits into
thesofproject:mainfrom
gjanca:ext_time

Conversation

@gjanca

@gjanca gjanca commented Dec 3, 2026

Copy link
Copy Markdown

Missing CONFIG_COUNTER=y on WCL
basefw_get_ext_system_time() in sof/src/kernel/audio/base_fw_intel.c is compiled only when both
CONFIG_ACE_V1X_ART_COUNTER and CONFIG_ACE_V1X_RTC_COUNTER are enabled.
These Zephyr drivers depend on CONFIG_COUNTER
Consequently, the WCL build compiles only the return IPC4_UNAVAILABLE
it never reads the counters, calculates UTC, or writes the 24-byte ipc4_ext_system_time structure.
This is the change necessary to reach the valid 24-byte response path on WCL

Enable CONFIG_COUNTER on intel_adsp_ace30_wcl so Zephyr compiles
the ACE ART and RTC counter drivers needed by
basefw_get_ext_system_time().

Without CONFIG_COUNTER=y, IPC4_EXTENDED_SYSTEM_TIME falls through
to the unavailable path instead of returning the 24-byte extended
system time payload.

Signed-off-by: Grzegorz Janca <grzegorz.janca@intel.com>
Convert sof_cycle_get_64() to microseconds with
k_cyc_to_us_floor64() before subtracting dsp_time in
basefw_get_ext_system_time(). basefw_set_system_time() stores
dsp_time in microseconds, so subtracting it from raw XTAL cycles
and dividing by truncated MHz produced wrong UTC values.

Validate ART and RTC counter readiness with device_is_ready() and
check counter_get_value_64() return status before building the
IPC4 response.

Signed-off-by: Grzegorz Janca <grzegorz.janca@intel.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 16:00
@sofci

sofci commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

reply test this please to run this test once

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the IPC4 extended system time changes.

No open issues 🎉

What changed in this PR

Fixes IPC4 extended system time handling in SOF by enabling WCL counters and correcting timestamp calculations.

Changes:

  • Enables the counter subsystem on WCL.
  • Checks counter readiness and handles read failures.
  • Converts DSP cycles to microseconds before calculating elapsed time.
File Description
src/​kernel/​audio/​base_fw_intel.c Corrects time conversion and validates counter access.
app/​boards/​intel_adsp_ace30_wcl.conf Enables CONFIG_COUNTER for WCL.

Review effort: Balanced

@lgirdwood

Copy link
Copy Markdown
Member

test this please

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.

4 participants