The kernel migration queue scheduler is shared across all VMs on a tile.
When a job times out and GT recovery is exhausted (karma > threshold),
guc_exec_queue_timedout_job() falls through to error out the job and
cancel all remaining pending jobs via drm_sched_for_each_pending_job().

After a GT reset, the hardware is recovered and those pending jobs can
run fine. Skip cancellation for kernel queues so that other VMs' migration
operations can complete after GT reset recovers the engine.

Fixes: 95f27831ee3c ("drm/xe: Stop abusing DRM scheduler internals")
Cc: Matthew Brost <[email protected]>
Cc: Thomas Hellström <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Assisted-by: Claude:claude-opus-4.6
Suggested-by: Himal Prasad Ghimiray <[email protected]>
Signed-off-by: Sanjay Yadav <[email protected]>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c 
b/drivers/gpu/drm/xe/xe_guc_submit.c
index e6ad57cbbf0e..dd3ae58019b1 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -1640,8 +1640,15 @@ guc_exec_queue_timedout_job(struct drm_sched_job 
*drm_job)
 
        /* Mark all outstanding jobs as bad, thus completing them */
        xe_sched_job_set_error(job, err);
-       drm_sched_for_each_pending_job(tmp_job, &sched->base, NULL)
-               xe_sched_job_set_error(to_xe_sched_job(tmp_job), -ECANCELED);
+
+       /*
+        * For kernel queues (migration), don't cancel other pending jobs.
+        * They belong to different VMs sharing the same scheduler and will
+        * be resubmitted after GT reset recovers the hardware.
+        */
+       if (!(q->flags & EXEC_QUEUE_FLAG_KERNEL))
+               drm_sched_for_each_pending_job(tmp_job, &sched->base, NULL)
+                       xe_sched_job_set_error(to_xe_sched_job(tmp_job), 
-ECANCELED);
 
        if (xe_exec_queue_is_multi_queue(q)) {
                xe_guc_exec_queue_group_start(q);
-- 
2.52.0

Reply via email to