Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,18 @@ static int zephyr_ll_task_cancel(void *data, struct task *task)
* kept atomic, so we have to lock here too.
*/
zephyr_ll_lock(sch, &flags);
if (task->state != SOF_TASK_STATE_FREE) {

/*
* SOF_TASK_STATE_CANCEL can only be assigned to a task which is on scheduler's list.
* Later such task will be removed from the list by zephyr_ll_task_done(). Do nothing
* for tasks which were never scheduled or were already removed from scheduler's list.
*/
if (task->state != SOF_TASK_STATE_INIT && task->state != SOF_TASK_STATE_FREE) {
task->state = SOF_TASK_STATE_CANCEL;
/* let domain know that a task has been cancelled */
domain_task_cancel(sch->ll_domain, task);
}

zephyr_ll_unlock(sch, &flags);

return 0;
Expand Down