Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Take job list lock in xe_sched_first_pending_job
@ 2024-11-05 16:03 Nirmoy Das
  2024-11-05 16:50 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (16 more replies)
  0 siblings, 17 replies; 20+ messages in thread
From: Nirmoy Das @ 2024-11-05 16:03 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Matthew Brost

Access to the pending_list should always happens under job_list_lock.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_gpu_scheduler.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gpu_scheduler.h b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
index 64b2ae6839db..c250ea773491 100644
--- a/drivers/gpu/drm/xe/xe_gpu_scheduler.h
+++ b/drivers/gpu/drm/xe/xe_gpu_scheduler.h
@@ -71,8 +71,14 @@ static inline void xe_sched_add_pending_job(struct xe_gpu_scheduler *sched,
 static inline
 struct xe_sched_job *xe_sched_first_pending_job(struct xe_gpu_scheduler *sched)
 {
-	return list_first_entry_or_null(&sched->base.pending_list,
-					struct xe_sched_job, drm.list);
+	struct xe_sched_job *job;
+
+	spin_lock(&sched->base.job_list_lock);
+	job = list_first_entry_or_null(&sched->base.pending_list,
+				       struct xe_sched_job, drm.list);
+	spin_unlock(&sched->base.job_list_lock);
+
+	return job;
 }
 
 static inline int
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2024-11-12 10:04 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-05 16:03 [PATCH] drm/xe: Take job list lock in xe_sched_first_pending_job Nirmoy Das
2024-11-05 16:50 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-05 16:50 ` ✓ CI.checkpatch: " Patchwork
2024-11-05 16:52 ` ✓ CI.KUnit: " Patchwork
2024-11-05 17:03 ` ✓ CI.Build: " Patchwork
2024-11-05 17:05 ` ✓ CI.Hooks: " Patchwork
2024-11-05 17:07 ` ✓ CI.checksparse: " Patchwork
2024-11-05 17:33 ` ✓ CI.BAT: " Patchwork
2024-11-05 17:50 ` [PATCH] " Matthew Brost
2024-11-05 21:56   ` Nirmoy Das
2024-11-06 21:36 ` ✗ CI.FULL: failure for " Patchwork
2024-11-07  0:38 ` ✓ CI.Patch_applied: success for drm/xe: Take job list lock in xe_sched_first_pending_job (rev2) Patchwork
2024-11-07  0:38 ` ✓ CI.checkpatch: " Patchwork
2024-11-07  0:39 ` ✓ CI.KUnit: " Patchwork
2024-11-07  0:51 ` ✓ CI.Build: " Patchwork
2024-11-07  0:53 ` ✓ CI.Hooks: " Patchwork
2024-11-07  0:55 ` ✓ CI.checksparse: " Patchwork
2024-11-07  1:19 ` ✓ CI.BAT: " Patchwork
2024-11-08  6:22 ` ✗ CI.FULL: failure " Patchwork
2024-11-12 10:04   ` Nirmoy Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox