Skip to content

Commit c002bfe

Browse files
mbrost05lucasdemarchi
authored andcommitted
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: dd08ebf ("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 (cherry picked from commit 50aec96) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 7bd9c9f commit c002bfe

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/gpu/drm/xe/xe_guc_ct.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static void guc_ct_fini(struct drm_device *drm, void *arg)
120120
{
121121
struct xe_guc_ct *ct = arg;
122122

123+
destroy_workqueue(ct->g2h_wq);
123124
xa_destroy(&ct->fence_lookup);
124125
}
125126

@@ -145,6 +146,10 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
145146

146147
xe_assert(xe, !(guc_ct_size() % PAGE_SIZE));
147148

149+
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", 0);
150+
if (!ct->g2h_wq)
151+
return -ENOMEM;
152+
148153
spin_lock_init(&ct->fast_lock);
149154
xa_init(&ct->fence_lookup);
150155
INIT_WORK(&ct->g2h_worker, g2h_worker_func);

drivers/gpu/drm/xe/xe_guc_ct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static inline void xe_guc_ct_irq_handler(struct xe_guc_ct *ct)
3434
return;
3535

3636
wake_up_all(&ct->wq);
37-
queue_work(system_unbound_wq, &ct->g2h_worker);
37+
queue_work(ct->g2h_wq, &ct->g2h_worker);
3838
xe_guc_ct_fast_path(ct);
3939
}
4040

drivers/gpu/drm/xe/xe_guc_ct_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ struct xe_guc_ct {
120120
wait_queue_head_t wq;
121121
/** @g2h_fence_wq: wait queue used for G2H fencing */
122122
wait_queue_head_t g2h_fence_wq;
123+
/** @g2h_wq: used to process G2H */
124+
struct workqueue_struct *g2h_wq;
123125
/** @msg: Message buffer */
124126
u32 msg[GUC_CTB_MSG_MAX_LEN];
125127
/** @fast_msg: Message buffer */

0 commit comments

Comments
 (0)