diff options
author | Matthew Brost <matthew.brost@intel.com> | 2023-08-11 06:27:34 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:40:19 -0500 |
commit | a20c75dba192af6ba63d618514a064268dbbe7db (patch) | |
tree | 1632ac280b1c89ee819cde784646607546397642 /drivers/gpu/drm/xe/xe_guc_submit.c | |
parent | ca8656a2eb0930b991151588fd04e60c75465543 (diff) | |
download | lwn-a20c75dba192af6ba63d618514a064268dbbe7db.tar.gz lwn-a20c75dba192af6ba63d618514a064268dbbe7db.zip |
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: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc_submit.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_submit.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c index b3d765ee47f1..8ecfe2b15e28 100644 --- a/drivers/gpu/drm/xe/xe_guc_submit.c +++ b/drivers/gpu/drm/xe/xe_guc_submit.c @@ -956,27 +956,19 @@ static void __guc_exec_queue_fini_async(struct work_struct *w) xe_sched_entity_fini(&ge->entity); xe_sched_fini(&ge->sched); - if (!(q->flags & EXEC_QUEUE_FLAG_KERNEL)) { - kfree(ge); - xe_exec_queue_fini(q); - } + kfree(ge); + xe_exec_queue_fini(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); - queue_work(system_wq, &q->guc->fini_async); /* We must block on kernel engines so slabs are empty on driver unload */ - if (kernel) { - struct xe_guc_exec_queue *ge = q->guc; - - flush_work(&ge->fini_async); - kfree(ge); - xe_exec_queue_fini(q); - } + if (q->flags & EXEC_QUEUE_FLAG_KERNEL) + __guc_exec_queue_fini_async(&q->guc->fini_async); + else + queue_work(system_wq, &q->guc->fini_async); } static void __guc_exec_queue_fini(struct xe_guc *guc, struct xe_exec_queue *q) |