Skip to content

ams: take the local interrupt lock with arch_irq_lock() - #11624

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

lgirdwood wants to merge 1 commit into
thesofproject:mainfrom
lgirdwood:topic/zn-rtos-irqlock-kernel

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Take the local interrupt lock with arch_irq_lock() in the AMS code. Part of #11517 (step 6).

Kernel code uses the native Zephyr API. On Zephyr, irq_local_disable() and irq_local_enable() expand to arch_irq_lock() and arch_irq_unlock(). AMS, the kernel code that updates its pending slots under the lock, now calls them directly and keeps the key in an unsigned int, the type arch_irq_lock() returns. AMS is only built for Zephyr (MTL, LNL and TGL enable it).

Not in this PR

Functional change

None.

Testing

Tested as a stack of the four Wave D PRs on main 73a7797 (this PR does not depend on the others):

  • Builds: every commit built incrementally and the tip from scratch, for tgl, tgl-h, mtl, lnl, ptl, wcl, nvl, nvl-s, imx8, imx8x, imx8m, imx8m_cm7, imx8ulp, imx93, imx95, qemu_xtensa, qemu_xtensa_mmu, native_sim, and the PTL userspace, LL-userspace and LLEXT, MTL LLEXT, TGL/PTL debug-stream and TGL/MTL/LNL/PTL CI overlay configurations.
  • Objects: every object hashed with the debug sections stripped and compared commit by commit. No object changes, apart from the objects that embed the git version.
  • Platforms that already fail on main (acp_6_0, acp_7_0, acp_7_x, mt8186, mt8188, mt8195, mt8196, mt8365, phyboard): same error sets, and the same header dependencies.
  • Cadence xt-clang: MTL, PTL and NVL compile.
  • Host: the host library builds, and ZTest passes 38 of 38, run as in CI.
  • checkpatch: clean.

🤖 Generated with Claude Code

Kernel code uses the native Zephyr API. irq_local_disable() and
irq_local_enable() expand to arch_irq_lock() and arch_irq_unlock() on
Zephyr, so call them directly in the AMS pending slot updates, and keep
the lock key in an unsigned int, the type arch_irq_lock() returns.

The remaining kernel users of irq_local_disable() are the legacy DAI
driver and the DMA scheduling domain, which only the platforms without
native drivers build and which go with the legacy driver code.

No functional change.

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

2 participants