Commit a20c75db authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi

drm/xe: Call __guc_exec_queue_fini_async direct for KERNEL exec_queues

Usually we call __guc_exec_queue_fini_async via a worker as the
exec_queue fini can be done from within the GPU scheduler which creates
a circular dependency without a worker. Kernel exec_queues are fini'd at
driver unload (not from within the GPU scheduler) so it is safe to
directly call __guc_exec_queue_fini_async.
Suggested-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent ca8656a2
...@@ -956,27 +956,19 @@ static void __guc_exec_queue_fini_async(struct work_struct *w) ...@@ -956,27 +956,19 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)
xe_sched_entity_fini(&ge->entity); xe_sched_entity_fini(&ge->entity);
xe_sched_fini(&ge->sched); xe_sched_fini(&ge->sched);
if (!(q->flags & EXEC_QUEUE_FLAG_KERNEL)) { kfree(ge);
kfree(ge); xe_exec_queue_fini(q);
xe_exec_queue_fini(q);
}
} }
static void guc_exec_queue_fini_async(struct xe_exec_queue *q) static void guc_exec_queue_fini_async(struct xe_exec_queue *q)
{ {
bool kernel = q->flags & EXEC_QUEUE_FLAG_KERNEL;
INIT_WORK(&q->guc->fini_async, __guc_exec_queue_fini_async); INIT_WORK(&q->guc->fini_async, __guc_exec_queue_fini_async);
queue_work(system_wq, &q->guc->fini_async);
/* We must block on kernel engines so slabs are empty on driver unload */ /* We must block on kernel engines so slabs are empty on driver unload */
if (kernel) { if (q->flags & EXEC_QUEUE_FLAG_KERNEL)
struct xe_guc_exec_queue *ge = q->guc; __guc_exec_queue_fini_async(&q->guc->fini_async);
else
flush_work(&ge->fini_async); queue_work(system_wq, &q->guc->fini_async);
kfree(ge);
xe_exec_queue_fini(q);
}
} }
static void __guc_exec_queue_fini(struct xe_guc *guc, struct xe_exec_queue *q) static void __guc_exec_queue_fini(struct xe_guc *guc, struct xe_exec_queue *q)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment