[PATCH] drm/xe: Grab pending job list lock before resubmit

Tejas Upadhyay tejas.upadhyay at intel.com
Tue Jun 17 14:47:53 UTC 2025


Pending job list is protected by pending job lock to
avoid any racing thus grab pending job list lock before
resubmitting jobs.

Fixes: 38fafa9f392f ("drm/xe/sched: stop re-submitting signalled jobs")
Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
---
 drivers/gpu/drm/xe/xe_gpu_scheduler.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
index 308061f0cf37..dfdb409da6ba 100644
--- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
+++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
@@ -53,6 +53,7 @@ static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched)
 {
 	struct drm_sched_job *s_job;
 
+	spin_lock(&sched->base.job_list_lock);
 	list_for_each_entry(s_job, &sched->base.pending_list, list) {
 		struct drm_sched_fence *s_fence = s_job->s_fence;
 		struct dma_fence *hw_fence = s_fence->parent;
@@ -60,6 +61,7 @@ static inline void xe_sched_resubmit_jobs(struct xe_gpu_scheduler *sched)
 		if (hw_fence && !dma_fence_is_signaled(hw_fence))
 			sched->base.ops->run_job(s_job);
 	}
+	spin_unlock(&sched->base.job_list_lock);
 }
 
 static inline bool
-- 
2.34.1



More information about the Intel-xe mailing list