Skip to content
Draft
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
10 changes: 9 additions & 1 deletion src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ static int zephyr_ll_task_free(void *data, struct task *task)
uint32_t flags;
struct zephyr_ll_pdata *pdata = task->priv_data;
bool must_wait, on_list = true;
int wait_ret = 0;

zephyr_ll_assert_core(sch);

Expand Down Expand Up @@ -598,10 +599,17 @@ static int zephyr_ll_task_free(void *data, struct task *task)

if (must_wait)
/* Wait for up to 100 periods */
k_sem_take(pdata->sem_p, K_USEC(LL_TIMER_PERIOD_US * 100));
wait_ret = k_sem_take(pdata->sem_p, K_USEC(LL_TIMER_PERIOD_US * 100));

/* Protect against racing with schedule_task() */
zephyr_ll_lock(sch, &flags);

if (wait_ret && task->state != SOF_TASK_STATE_FREE) {
tr_warn(&ll_tr, "task %p still active on free (state %d, semret %d)",
task, task->state, wait_ret);
zephyr_ll_task_done(sch, task);
}

#if CONFIG_DYNAMIC_OBJECTS
zephyr_ll_task_sem_free(task);
#endif
Expand Down
Loading