]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Do not wedge device on killed exec queues
authorMatthew Brost <matthew.brost@intel.com>
Tue, 24 Jun 2025 17:41:03 +0000 (10:41 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 25 Jun 2025 16:55:20 +0000 (09:55 -0700)
When a user closes an exec queue or interrupts an app with Ctrl-C,
this does not warrant wedging the device in mode 2.

Avoid this by skipping the wedge check for killed exec queues in
the TDR and LR exec queue cleanup worker.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250624174103.2707941-1-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c

index df7a5a4eec74cc97c9934fb3ad383a2bae1d9a3d..72477ccc5c5e92cc80cce28e3e3366764e0e57d2 100644 (file)
@@ -908,12 +908,13 @@ static void xe_guc_exec_queue_lr_cleanup(struct work_struct *w)
        struct xe_exec_queue *q = ge->q;
        struct xe_guc *guc = exec_queue_to_guc(q);
        struct xe_gpu_scheduler *sched = &ge->sched;
-       bool wedged;
+       bool wedged = false;
 
        xe_gt_assert(guc_to_gt(guc), xe_exec_queue_is_lr(q));
        trace_xe_exec_queue_lr_cleanup(q);
 
-       wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
+       if (!exec_queue_killed(q))
+               wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
 
        /* Kill the run_job / process_msg entry points */
        xe_sched_submission_stop(sched);
@@ -1084,7 +1085,7 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
        int err = -ETIME;
        pid_t pid = -1;
        int i = 0;
-       bool wedged, skip_timeout_check;
+       bool wedged = false, skip_timeout_check;
 
        /*
         * TDR has fired before free job worker. Common if exec queue
@@ -1130,7 +1131,8 @@ guc_exec_queue_timedout_job(struct drm_sched_job *drm_job)
         * doesn't work for SRIOV. For now assuming timeouts in wedged mode are
         * genuine timeouts.
         */
-       wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
+       if (!exec_queue_killed(q))
+               wedged = guc_submit_hint_wedged(exec_queue_to_guc(q));
 
        /* Engine state now stable, disable scheduling to check timestamp */
        if (!wedged && exec_queue_registered(q)) {