Skip to content

Commit 2d9c72f

Browse files
mbrost05Thomas Hellström
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: Thomas Hellström <thomas.hellstrom@linux.intel.com>
1 parent 3bc8848 commit 2d9c72f

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
@@ -121,6 +121,7 @@ static void guc_ct_fini(struct drm_device *drm, void *arg)
121121
{
122122
struct xe_guc_ct *ct = arg;
123123

124+
destroy_workqueue(ct->g2h_wq);
124125
xa_destroy(&ct->fence_lookup);
125126
}
126127

@@ -146,6 +147,10 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
146147

147148
xe_gt_assert(gt, !(guc_ct_size() % PAGE_SIZE));
148149

150+
ct->g2h_wq = alloc_ordered_workqueue("xe-g2h-wq", 0);
151+
if (!ct->g2h_wq)
152+
return -ENOMEM;
153+
149154
spin_lock_init(&ct->fast_lock);
150155
xa_init(&ct->fence_lookup);
151156
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)