Skip to content

telemetry: call the Zephyr cache API directly - #11615

Merged
lgirdwood merged 1 commit into
thesofproject:mainfrom
lgirdwood:topic/zn-rtos-cache-telemetry
Dec 4, 2026
Merged

lgirdwood merged 1 commit into
thesofproject:mainfrom
lgirdwood:topic/zn-rtos-cache-telemetry

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Call the Zephyr cache API directly in the extended telemetry window code. Part of #11517 (step 2).

The kernel-only code switched from the SOF cache wrappers to the Zephyr calls in #11571, but telemetry_late_init() added a new dcache_writeback_region() call afterwards. It now calls sys_cache_data_flush_range() directly. telemetry_ext_ready is a plain bool, so the __sparse_cache cast that only matched the wrapper prototype goes away. No lines are added or removed.

After this and #11598 (shared code), no code calls dcache_writeback_region(), dcache_invalidate_region(), dcache_writeback_invalidate_region() or icache_invalidate_region(), and a follow-up can remove them.

Functional change

None.

Testing

  • Builds: MTL, LNL, PTL and WCL, the platforms that enable CONFIG_SOF_TELEMETRY (and with it CONFIG_SOF_TELEMETRY_EXTENDED_WINDOW).
  • Objects: telemetry.c.obj compared with main (66a6139), debug sections stripped. Identical on PTL. On MTL the code is identical, and only the name of a compiler-generated switch table (CSWTCH$241 → CSWTCH$240) differs.

🤖 Generated with Claude Code

dcache_writeback_region() is an inline wrapper of
sys_cache_data_flush_range(). The kernel-only code switched to the
Zephyr call in commit 1e6fb6b ("zephyr: call the Zephyr cache API
directly in kernel-only code"), but the extended telemetry window code
added a new call to the wrapper afterwards. Call the Zephyr function
directly here too.

telemetry_ext_ready is a plain bool, so it no longer needs the
__sparse_cache cast that only matched the wrapper prototype. No lines
are added or removed.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood requested a balanced review from Copilot December 4, 2026 12:51
@lgirdwood
lgirdwood marked this pull request as ready for review December 4, 2026 12:54

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 remain for the telemetry initialization update to Zephyr’s cache API.

No open issues 🎉

What changed in this PR

Updates extended telemetry initialization to use Zephyr’s cache API directly, continuing the removal of legacy SOF wrappers. No functional change is intended.

Changes:

  • Replaces dcache_writeback_region() with sys_cache_data_flush_range().
  • Removes the unnecessary sparse pointer cast.
File Description
src/​kernel/​debug/​telemetry/​telemetry.c Flushes the telemetry readiness flag through the native Zephyr API.

Review effort: Balanced

@intel-sofci

Copy link
Copy Markdown

PR 11615: test results

Run date: 2026-12-04 13:25 UTC

Tested commit: 49ee1e041405002b7dd3e7c186da93a8e9b2122e

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

dcache_writeback_region((__sparse_force void __sparse_cache *)&telemetry_ext_ready,
sizeof(telemetry_ext_ready));
sys_cache_data_flush_range(&telemetry_ext_ready,
sizeof(telemetry_ext_ready));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would fit one line...

@lgirdwood
lgirdwood merged commit 751a6af into thesofproject:main Dec 4, 2026
45 of 47 checks passed
@lgirdwood
lgirdwood deleted the topic/zn-rtos-cache-telemetry branch December 4, 2026 18:47
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