schedule: fix schedule list double add

Check if the schedule task is added in the list before add it.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
This commit is contained in:
Pan Xiuli 2018-09-06 13:55:44 +08:00
parent 869c08d6c0
commit 85e1c0d738
1 changed files with 7 additions and 0 deletions

View File

@ -257,6 +257,13 @@ static int _schedule_task(struct task *task, uint64_t start, uint64_t deadline)
return 0; return 0;
} }
/* is task already running ? - not enough MIPS to complete ? */
if (task->state == TASK_STATE_QUEUED) {
trace_pipe("tsq");
spin_unlock_irq(&sch->lock, flags);
return 0;
}
/* get the current time */ /* get the current time */
current = platform_timer_get(platform_timer); current = platform_timer_get(platform_timer);