Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Use ordered WQ for G2H handler

System work queues are shared, use a dedicated work queue for G2H
processing to avoid G2H processing getting block behind system tasks.

Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240506034758.3697397-1-matthew.brost@intel.com

+8 -1
+5
drivers/gpu/drm/xe/xe_guc_ct.c
··· 121 121 { 122 122 struct xe_guc_ct *ct = arg; 123 123 124 + destroy_workqueue(ct->g2h_wq); 124 125 xa_destroy(&ct->fence_lookup); 125 126 } 126 127 ··· 146 145 int err; 147 146 148 147 xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE)); 148 + 149 + ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", 0); 150 + if (!ct->g2h_wq) 151 + return -ENOMEM; 149 152 150 153 spin_lock_init(&ct->fast_lock); 151 154 xa_init(&ct->fence_lookup);
+1 -1
drivers/gpu/drm/xe/xe_guc_ct.h
··· 34 34 return; 35 35 36 36 wake_up_all(&ct->wq); 37 - queue_work(system_unbound_wq, &ct->g2h_worker); 37 + queue_work(ct->g2h_wq, &ct->g2h_worker); 38 38 xe_guc_ct_fast_path(ct); 39 39 } 40 40
+2
drivers/gpu/drm/xe/xe_guc_ct_types.h
··· 120 120 wait_queue_head_t wq; 121 121 /** @g2h_fence_wq: wait queue used for G2H fencing */ 122 122 wait_queue_head_t g2h_fence_wq; 123 + /** @g2h_wq: used to process G2H */ 124 + struct workqueue_struct *g2h_wq; 123 125 /** @msg: Message buffer */ 124 126 u32 msg[GUC_CTB_MSG_MAX_LEN]; 125 127 /** @fast_msg: Message buffer */