Commit ed931fb4 authored by Matthew Brost's avatar Matthew Brost Committed by Lucas De Marchi
Browse files

drm/xe: Take job list lock in xe_sched_add_pending_job



A fragile micro optimization in xe_sched_add_pending_job relied on both
the GPU scheduler being stopped and fence signaling stopped to safely
add a job to the pending list without the job list lock in
xe_sched_add_pending_job. Remove this optimization and just take the job
list lock.

Fixes: 7ddb9403 ("drm/xe: Sample ctx timestamp to determine if jobs have timed out")
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003001657.3517883-2-matthew.brost@intel.com


(cherry picked from commit 90521df5)
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent 761f916a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -63,7 +63,9 @@ xe_sched_invalidate_job(struct xe_sched_job *job, int threshold)
static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
					    struct xe_sched_job *job)
{
	spin_lock(&sched->base.job_list_lock);
	list_add(&job->drm.list, &sched->base.pending_list);
	spin_unlock(&sched->base.job_list_lock);
}

static inline