drm/xe: Only enable scheduling upon resume if needed
authorMatthew Brost <matthew.brost@intel.com>
Fri, 9 Aug 2024 19:19:28 +0000 (12:19 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Sat, 10 Aug 2024 02:07:31 +0000 (19:07 -0700)
No need to enable scheduling in already enabled.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809191929.3138956-5-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c

index 4608085..a9af33f 100644 (file)
@@ -1374,9 +1374,11 @@ static void __guc_exec_queue_process_msg_resume(struct xe_sched_msg *msg)
        struct xe_exec_queue *q = msg->private_data;
 
        if (guc_exec_queue_allowed_to_change_state(q)) {
-               q->guc->resume_time = RESUME_PENDING;
                clear_exec_queue_suspended(q);
-               enable_scheduling(q);
+               if (!exec_queue_enabled(q)) {
+                       q->guc->resume_time = RESUME_PENDING;
+                       enable_scheduling(q);
+               }
        } else {
                clear_exec_queue_suspended(q);
        }