summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejas Upadhyay <tejas.upadhyay@intel.com>2025-02-25 07:57:54 +0300
committerTejas Upadhyay <tejas.upadhyay@intel.com>2025-02-26 08:29:17 +0300
commit18fbd567e75f9b97b699b2ab4f1fa76b7cf268f6 (patch)
tree44b60059cd906017c97b66e61a844e0e5ab0c83a
parent6b68c4542ffecc36087a9e14db8fc990c88bb01b (diff)
downloadlinux-18fbd567e75f9b97b699b2ab4f1fa76b7cf268f6.tar.xz
drm/xe: cancel pending job timer before freeing scheduler
The async call to __guc_exec_queue_fini_async frees the scheduler while a submission may time out and restart. To prevent this race condition, the pending job timer should be canceled before freeing the scheduler. V3(MattB): - Adjust position of cancel pending job - Remove gitlab issue# from commit message V2(MattB): - Cancel pending jobs before scheduler finish Fixes: a20c75dba192 ("drm/xe: Call __guc_exec_queue_fini_async direct for KERNEL exec_queues") Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250225045754.600905-1-tejas.upadhyay@intel.com Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_guc_submit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 913c74d6e2ae..b6a2dd742ebd 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1248,6 +1248,8 @@ static void __guc_exec_queue_fini_async(struct work_struct *w)
if (xe_exec_queue_is_lr(q))
cancel_work_sync(&ge->lr_tdr);
+ /* Confirm no work left behind accessing device structures */
+ cancel_delayed_work_sync(&ge->sched.base.work_tdr);
release_guc_id(guc, q);
xe_sched_entity_fini(&ge->entity);
xe_sched_fini(&ge->sched);