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
19 changes: 10 additions & 9 deletions src/schedule/zephyr_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static void zephyr_ll_assert_core(const struct zephyr_ll *sch)
static void zephyr_ll_task_done(struct zephyr_ll *sch,
Comment thread
kv2019i marked this conversation as resolved.
struct task *task)
{
struct zephyr_ll_pdata *pdata = task->priv_data;

list_item_del(&task->list);

if (!sch->n_tasks) {
Expand All @@ -66,6 +68,13 @@ static void zephyr_ll_task_done(struct zephyr_ll *sch,

task->state = SOF_TASK_STATE_FREE;

if (pdata->freeing)
/*
* zephyr_ll_task_free() is trying to free this task. Complete
* it and signal the semaphore to let the function proceed
*/
k_sem_give(&pdata->sem);

tr_info(&ll_tr, "task complete %p %pU", task, task->uid);
tr_info(&ll_tr, "num_tasks %d total_num_tasks %ld",
sch->n_tasks, atomic_read(&sch->ll_domain->total_num_tasks));
Expand Down Expand Up @@ -212,15 +221,7 @@ static void zephyr_ll_run(void *data)

zephyr_ll_lock(sch, &flags);

if (pdata->freeing) {
/*
* zephyr_ll_task_free() is trying to free this task.
* complete it and signal the semaphore to let the
* function proceed
*/
zephyr_ll_task_done(sch, task);
k_sem_give(&pdata->sem);
} else if (state == SOF_TASK_STATE_COMPLETED) {
if (pdata->freeing || state == SOF_TASK_STATE_COMPLETED) {
zephyr_ll_task_done(sch, task);
} else {
/*
Expand Down