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); } /** 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) {