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
13 changes: 11 additions & 2 deletions src/lib/schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ static inline struct task *edf_get_next(uint64_t current,
trace_pipe("ed!");

/* have we already tried to rescheule ? */
if (reschedule++)
if (!reschedule) {
reschedule++;
trace_pipe("edr");
edf_reschedule(task, current);
else {
} else {
/* reschedule failed */
list_item_del(&task->list);
task->state = TASK_STATE_CANCEL;
Expand Down Expand Up @@ -267,6 +269,13 @@ static int _schedule_task(struct task *task, uint64_t start, uint64_t deadline)
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 */
current = platform_timer_get(platform_timer);

Expand Down