Skip to content

Commit 299bc6d

Browse files
Intel-ArvindYadavThomas Hellström
authored andcommitted
drm/xe/guc: Keep scheduler timeline name alive
The scheduler keeps a pointer to the timeline name, but q->name is freed with the exec queue while scheduler fences can still reference it. Store the name in struct xe_guc_exec_queue so it shares the scheduler's RCU-deferred lifetime. Fixes: 6bd90e7 ("drm/xe: Make dma-fences compliant with the safe access rules") Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Arvind Yadav <arvind.yadav@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Acked-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260714064402.2457257-1-arvind.yadav@intel.com Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com> (cherry picked from commit 41075f0) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 6384271 commit 299bc6d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/gpu/drm/xe/xe_guc_exec_queue_types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/workqueue.h>
1111

1212
#include "xe_gpu_scheduler_types.h"
13+
#include "xe_hw_fence_types.h"
1314

1415
struct dma_fence;
1516
struct xe_exec_queue;
@@ -24,6 +25,10 @@ struct xe_guc_exec_queue {
2425
struct rcu_head rcu;
2526
/** @sched: GPU scheduler for this xe_exec_queue */
2627
struct xe_gpu_scheduler sched;
28+
/**
29+
* @name: Scheduler timeline name, kept with @sched until RCU free.
30+
*/
31+
char name[MAX_FENCE_NAME_LEN];
2732
/** @entity: Scheduler entity for this xe_exec_queue */
2833
struct xe_sched_entity entity;
2934
/**

drivers/gpu/drm/xe/xe_guc_submit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,6 +1955,8 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
19551955

19561956
xe_exec_queue_assign_name(q, q->guc->id);
19571957

1958+
strscpy(ge->name, q->name, sizeof(ge->name));
1959+
19581960
/*
19591961
* Use primary queue's submit_wq for all secondary queues of a
19601962
* multi queue group. This serialization avoids any locking around
@@ -1969,7 +1971,7 @@ static int guc_exec_queue_init(struct xe_exec_queue *q)
19691971
err = xe_sched_init(&ge->sched, &drm_sched_ops, &xe_sched_ops,
19701972
submit_wq, xe_lrc_ring_size() / MAX_JOB_SIZE_BYTES, 64,
19711973
timeout, guc_to_gt(guc)->ordered_wq, NULL,
1972-
q->name, gt_to_xe(q->gt)->drm.dev);
1974+
ge->name, gt_to_xe(q->gt)->drm.dev);
19731975
if (err)
19741976
goto err_release_id;
19751977

0 commit comments

Comments
 (0)