mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08:00
drm/xe: Take job list lock in xe_sched_first_pending_job
Access to the pending_list should always happens under job_list_lock. Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241105160327.2970277-1-nirmoy.das@intel.com Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user