Skip to content

zephyr: remove unused interrupt and debug linkage stubs - #11573

Draft
lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:topic/zn-rtos-irq-stubs
Draft

lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:topic/zn-rtos-irq-stubs

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Remove the interrupt and debug linkage stubs that zephyr/wrapper.c still carries for XTOS-era code. Part of #11517 (step 1, "the wrapper.c IRQ linkage stubs"); #11516 did not cover them.

Changes

  1. Removed:
    • irq_name_level2[] and irq_name_level5[]: nothing refers to them.
    • arch_dump_regs_a(): nothing calls it.
    • platform_interrupt_set() and platform_interrupt_clear(): only the legacy interrupt API in interrupt-legacy.h calls them. Only the AMD platforms without native drivers use that API, and acp_6_0, the only such platform, defines its own versions in rembrandt/interrupt.c.
  2. _xtos_ints_off() is only built for the AMD platforms without native drivers, because arch_interrupt_disable_mask() in their legacy interrupt code still calls it.
  3. LL scheduler: take the local interrupt lock with arch_irq_lock() and arch_irq_unlock() directly. irq_local_disable() and irq_local_enable() expand to the same calls.

These symbols were also searched for in the Zephyr tree, the modules and their prebuilt libraries. None of them refers to the removed symbols.

Not in this PR

interrupt_mask() and interrupt_unmask() stubs: the legacy DMA domains can still call them on MediaTek, which does not build on main, so they go with the legacy driver removal (#11517 step 14).

Functional change

None. Only wrapper.c changes, by losing the removed functions and data; zephyr_ll.c compiles to the same code.

Testing

🤖 Generated with Claude Code

zephyr/wrapper.c still defines symbols that the XTOS-era code needed
at link time:

- irq_name_level2[] and irq_name_level5[]: nothing refers to them.
- arch_dump_regs_a(): nothing calls it.
- platform_interrupt_set() and platform_interrupt_clear(): only the
  legacy interrupt API in interrupt-legacy.h calls them, which only the
  AMD platforms without native drivers use, and acp_6_0, the only such
  platform, defines its own versions in rembrandt/interrupt.c.

Remove them. _xtos_ints_off() is still needed by
arch_interrupt_disable_mask() in the legacy interrupt code, so only
build it for the AMD platforms without native drivers.

In the LL scheduler, take the local interrupt lock with arch_irq_lock()
and arch_irq_unlock() directly instead of the irq_local_disable() and
irq_local_enable() macros, which expand to the same calls.

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

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.

🟡 Changes recommended

The removed stubs cause unresolved references in Zephyr ACP 6.0 builds, and removing the debug anchor breaks the coredump backtrace command.

2 open issues
What changed in this PR

This PR advances SOF’s migration away from XTOS-era code under #11517 by removing legacy linkage stubs and using Zephyr’s local interrupt APIs directly.

Changes:

  • Removes interrupt-name symbols, platform interrupt stubs, and the debug register-dump stub.
  • Limits _xtos_ints_off() to AMD builds without native drivers.
  • Replaces LL scheduler interrupt wrappers with arch_irq_lock() and arch_irq_unlock().
File Description
zephyr/​wrapper.c Removes legacy linkage symbols and restricts the remaining XTOS interrupt helper.
src/​schedule/​zephyr_ll.c Uses Zephyr’s local interrupt lock and unlock calls directly.

Review effort: Balanced

Comment thread zephyr/wrapper.c
@@ -118,16 +112,6 @@ void interrupt_unmask(uint32_t irq, unsigned int cpu)
}
#endif

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All non native zephyr code is getting removed, platforms have to transition to native zephyr.

Comment thread zephyr/wrapper.c
return host_notify + cpu_get_id();
}

#if defined(CONFIG_AMD) && !defined(CONFIG_ZEPHYR_NATIVE_DRIVERS)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Zephyr tooling should be used here, will check that this change compiles with Zephyr, if so we could also remove the old sof script too.

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