Skip to content

platform, idc: remove unused legacy DAI driver, IDC hooks and no-op stub - #11540

Merged
lgirdwood merged 3 commits into
thesofproject:mainfrom
lgirdwood:topic/platform-leftovers
Nov 27, 2026
Merged

lgirdwood merged 3 commits into
thesofproject:mainfrom
lgirdwood:topic/platform-leftovers

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Remove the dead platform and IDC code found while cleaning up the platform headers (#11528, #11529, #11532, #11534, #11537). These are functions and a source file, which the header and macro checks did not cover.

Patches

  1. platform: posix: remove the unused legacy DAI driver. src/kernel/platform/posix/dai.c registers a legacy SOF DAI driver from posix_dai_init(), but nothing has called that function since it was added in c50eddc. The native_sim builds use the Zephyr native drivers, and the fuzzing configuration gets its DAI from dai_virtual.c (CONFIG_DAI_POSIX). The posix platform/lib/dai.h stays, because the ztest unit tests, which do not enable CONFIG_ZEPHYR_NATIVE_DRIVERS, include it through sof/lib/dai-legacy.h.
  2. idc: remove the unused idc_restore() and platform IDC declarations. idc_restore() has had no caller since the XTOS power management code was removed. platform_idc_init() and platform_idc_restore() are still declared in the Zephyr and posix rtos/idc.h, but no platform has defined them since the XTOS IDC drivers were removed.
  3. platform: imx8ulp: remove the no-op platform_shared_commit(). 580b9cf removed it as a no-op on all platforms. The i.MX8ULP platform, added later, brought back an empty copy and a call in platform_clock_init().

Functional change

None. idc.c no longer has idc_restore(), but the linker already discarded it from the images.

Testing

Run on d80a052 (current main), at every commit and at the tip.

  • Firmware, every commit, incremental builds of 37 configurations:

    • tgl, tgl-h, mtl, lnl, ptl, wcl, nvl, nvl-s;
    • the internal CI configuration of tgl, mtl, lnl and ptl;
    • imx8, imx8x, imx8m, imx8m_cm7, imx8ulp, imx93, imx95;
    • qemu_xtensa, qemu_xtensa_mmu, native_sim;
    • PTL with the userspace overlay and with LL userspace, PTL and MTL with llext_relocatable.conf, PTL and TGL with debug_stream_overlay.conf;
    • the legacy acp_6_0, acp_7_0, acp_7_x, MediaTek and phyboard_pollux builds.

    Each commit builds the same configurations as main (the legacy ones fail with unchanged error sets). Objects, LLEXT modules and images were hashed with the debug sections stripped. Besides the objects that embed the source hash or git version, the only differences are idc.c from patch 2 and the native_sim dai.c object from patch 1, which is no longer built. LLEXT modules that the incremental builds relink also differ, but the pristine tip build shows they are identical.

  • Firmware, tip: a pristine build of the same matrix, compared with a pristine build of main.

    • Objects: all LLEXT modules are identical. The only differing objects are the version-bearing ones (init.c, ext_manifest.c, each platform.c, the final images) and idc.c in the 18 builds that compile it.
    • idc.c and the PTL image: on PTL, idc.c lost exactly idc_restore and its __func__ string, and zephyr.elf has an identical symbol set (names and sizes).
    • Legacy error sets: unchanged, except that the MediaTek configure error now points at line 575 of zephyr/CMakeLists.txt instead of 576.
    • Header dependencies (ninja -t deps): native_sim no longer includes the posix platform/lib/dai.h.
  • Host, every commit: the host library and the cmocka unit test builds (unit_test, imx8, mtk defconfigs) pass. With the debug sections stripped, all 1,291 objects are identical to main at every commit.

  • native_sim IPC3/IPC4 stub builds: pass.

  • ZTest: 23 of 23 pass, run as in CI.

  • check_kernel_includes.py --sources --strict: passes, and so does check_platform_headers.py --strict from scripts, .github: check for unused platform headers and macros #11538.

  • Documentation: builds with no warnings at every commit.

🤖 Generated with Claude Code

lrgirdwo and others added 3 commits November 25, 2026 16:48
posix/dai.c implements a legacy SOF DAI driver for the native_sim
platform, but nothing has called posix_dai_init(), which registers it,
since it was added in commit c50eddc ("platform: Add Zephyr
native_posix-based emulation environment"). The native_sim builds use
the Zephyr native drivers; the fuzzing configuration gets its DAI from
dai_virtual.c (CONFIG_DAI_POSIX). Remove the file and posix_dai_init().

platform/lib/dai.h stays: the ztest unit tests, which do not enable
CONFIG_ZEPHYR_NATIVE_DRIVERS, still include it through
sof/lib/dai-legacy.h.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
idc_restore() has had no caller since the XTOS power management code
was removed, and it is not declared in any header. The platform IDC
hooks platform_idc_init() and platform_idc_restore() are still declared
in the Zephyr and posix rtos/idc.h, but no platform defines them since
the XTOS IDC drivers were removed. Remove them.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Commit 580b9cf ("memory: remove platform_shared_commit() as it's a
NOP on all platforms") removed it, but the i.MX8ULP platform, added
later, brought back an empty copy and a call in platform_clock_init().
Remove both.

No functional change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@intel-sofci

Copy link
Copy Markdown

PR 11540: test results

Run date: 2026-11-26 21:10 UTC

Tested commit: 5cac42fc20125f218736da3fdda1bb388f975d70

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

@lgirdwood

Copy link
Copy Markdown
Member Author

Unrelated CI errors

@lgirdwood
lgirdwood merged commit 032bf6e into thesofproject:main Nov 27, 2026
45 of 47 checks passed
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