From 85238d8a0d08030c40aa29dd1b9a3d602cd087af Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Mon, 22 Jun 2026 14:06:13 +0200 Subject: [PATCH] ptl: userspace: handle userspace module IPC in the DP thread The current k_work_user_q-based worker used for userspace IPC processing does not work in the multicore case. An assert is triggered in k_thread_cpu_pin() when a userspace module is created on a secondary core. k_thread_cpu_pin() only works for a thread that is not currently running. Unfortunately, k_work_user_queue_start() not only initializes the queue but also immediately starts its worker thread on core 0. By the time k_thread_cpu_pin() is called, the worker thread may still be running (in our test it always is) and has not yet reached the wait condition in its loop where it goes to sleep. Wrapping the k_thread_cpu_pin() call in k_thread_suspend() and k_thread_resume() does not help either: this time the firmware hangs (sometimes, depending on the log level) in k_thread_suspend() due to a race. If the worker thread reaches its wait condition just before the IPI (triggered by k_thread_suspend()) is processed, k_thread_suspend() waits forever for the thread to become suspended. A possible fix would be to create a work queue per core and pin their threads from core 0, e.g. from secondary_core_init(). Or, more simply, switch to the implementation that uses the DP thread, as is done here. Signed-off-by: Serhiy Katsyuba --- app/boards/intel_adsp_ace30_ptl.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index b6ac41938398..e63913679f7b 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -74,6 +74,7 @@ CONFIG_DYNAMIC_THREAD=y CONFIG_DYNAMIC_THREAD_ALLOC=y CONFIG_DYNAMIC_THREAD_PREFER_ALLOC=y CONFIG_SOF_STACK_SIZE=8192 +CONFIG_SOF_USERSPACE_MOD_IPC_BY_DP_THREAD=y CONFIG_SOF_USERSPACE_PROXY=y CONFIG_MAX_THREAD_BYTES=3