ll_schedule: fix possible race condition

Fixes very rare race condition, when multiple cores
schedule something in low latency scheduler. We should
allow for timer client to execute one more time after
being cancelled. There won't be any tasks on the list
to process, but at least we will stop everything
gracefully.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2019-08-01 14:25:33 +02:00 committed by Liam Girdwood
parent ca45e75244
commit f068ddd771
1 changed files with 1 additions and 4 deletions

View File

@ -105,11 +105,8 @@ static inline void ll_clear_timer(struct ll_schedule_data *queue)
if (!atomic_sub(&ll_shared_ctx->total_num_work, 1))
queue->ts->timer_clear(&queue->ts->timer);
if (!atomic_sub(&queue->num_ll, 1)) {
timer_disable(&queue->ts->timer);
atomic_sub(&ll_shared_ctx->timer_clients, 1);
if (!atomic_sub(&queue->num_ll, 1))
ll_shared_ctx->timers[cpu_get_id()] = NULL;
}
}
/* is there any work pending in the current time window ? */