From 98a8ddb434730ed2a77058374e1d92b6329ab31c Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Fri, 16 Jan 2026 17:26:33 +0100 Subject: [PATCH 1/2] dp: Allow scheduling of already running DP task The DP task is started at pipeline start and stopped when the DP module is freed. Since the pipeline can be paused and resumed multiple times, DP task start may be called when the task is already queued/running. This commit allows the DP task to be scheduled even when it was already started. This fixes DP tests with multiple pipeline pause/resume cycles. Signed-off-by: Serhiy Katsyuba --- src/schedule/zephyr_dp_schedule.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index c3f9f6e30211..1418baf4cc6d 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -325,6 +325,12 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta lock_key = scheduler_dp_lock(cpu_get_id()); + if (task_is_active(task)) { + scheduler_dp_unlock(lock_key); + tr_dbg(&dp_tr, "DP task already active"); + return 0; + } + if (task->state != SOF_TASK_STATE_INIT && task->state != SOF_TASK_STATE_CANCEL && task->state != SOF_TASK_STATE_COMPLETED) { From bd2bdca16e699228904d0c1d594fd7900112088a Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba Date: Fri, 16 Jan 2026 17:27:09 +0100 Subject: [PATCH 2/2] idc: dp: Remove redundant switch code The switch code is not needed because the comp_trigger() call above invokes comp_trigger_local(), which already contains the appropriate switch logic. The version in comp_trigger_local() is the correct implementation for DP, with schedule_task_cancel() call removed by thesofproject/sof@d99cea9. This commit fixes DP tests with DP modules located on secondary cores. Signed-off-by: Serhiy Katsyuba --- src/idc/idc.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/idc/idc.c b/src/idc/idc.c index c3656008f1c5..bafa44299073 100644 --- a/src/idc/idc.c +++ b/src/idc/idc.c @@ -222,32 +222,12 @@ static int idc_trigger(uint32_t comp_id) struct idc *idc = *idc_get(); struct idc_payload *payload = idc_payload_get(idc, cpu_get_id()); uint32_t cmd = *(uint32_t *)payload; - int ret; ipc_dev = ipc_get_comp_by_id(ipc, comp_id); if (!ipc_dev) return -ENODEV; - ret = comp_trigger(ipc_dev->cd, cmd); - if (ret < 0) - goto out; - - /* schedule or cancel task */ - switch (cmd) { - case COMP_TRIGGER_START: - case COMP_TRIGGER_RELEASE: - schedule_task(ipc_dev->cd->task, 0, ipc_dev->cd->period); - break; - case COMP_TRIGGER_XRUN: - case COMP_TRIGGER_PAUSE: - case COMP_TRIGGER_STOP: - schedule_task_cancel(ipc_dev->cd->task); - break; - } - -out: - - return ret; + return comp_trigger(ipc_dev->cd, cmd); } /**