if (sched->current_entity && (sched->current_entity != tmp))
wake_entity = sched->current_entity;
sched->current_entity = tmp;
- if (wake_entity)
+ if (wake_entity && wake_entity->need_wakeup)
wake_up(&wake_entity->wait_queue);
return tmp;
}
entity->fence_context = fence_context_alloc(1);
snprintf(name, sizeof(name), "c_entity[%llu]", entity->fence_context);
memcpy(entity->name, name, 20);
+ entity->need_wakeup = false;
if(kfifo_alloc(&entity->job_queue,
jobs * sizeof(void *),
GFP_KERNEL))
if (!is_context_entity_initialized(sched, entity))
return 0;
-
+ entity->need_wakeup = true;
/**
* The client will not queue more IBs during this fini, consume existing
* queued IBs
*/
schedule();
}
-
- wake_up_interruptible(&sched->wait_queue);
+ /* first job wake up scheduler */
+ if ((kfifo_len(&c_entity->job_queue) / sizeof(void *)) == 1)
+ wake_up_interruptible(&sched->wait_queue);
return 0;
}