Skip to content

Commit cf8944e

Browse files
tmlemankv2019i
authored andcommitted
ipc3: Fix spinlock violation in PM context save on fuzzer
Fix spinlock validation assertion failure during fuzzing on native_sim builds with IPC3. Recent Zephyr commit added spinlock validation that detects context switching while holding spinlocks. This revealed that `ipc_pm_context_save` calls `arch_irq_lock` before the EDF work queue yields, causing: ASSERTION FAIL [arch_irq_unlocked(key) || ...] Context switching while holding lock! The hardware PM operations (arch_irq_lock, platform_timer_stop, etc.) are not needed for POSIX simulation environments. Extend the existing guard to exclude these operations when CONFIG_ZEPHYR_POSIX is defined. This preserves PM functionality while avoiding spinlock violations in native simulation builds. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 6b875ba commit cf8944e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ipc/ipc3/handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ static int ipc_pm_context_save(uint32_t header)
672672
/* do platform specific suspending */
673673
platform_context_save(sof_get());
674674

675-
#if !defined(CONFIG_LIBRARY)
675+
#if !defined(CONFIG_LIBRARY) && !defined(CONFIG_ZEPHYR_POSIX)
676676
/* TODO: check we are inactive - all streams are suspended */
677677

678678
/* TODO: mask ALL platform interrupts except DMA */

0 commit comments

Comments
 (0)