]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/guc_submit: Make suspend_wait interruptible
authorFrancois Dugast <francois.dugast@intel.com>
Fri, 9 Aug 2024 15:51:27 +0000 (17:51 +0200)
committerMatthew Brost <matthew.brost@intel.com>
Sun, 18 Aug 2024 01:31:50 +0000 (18:31 -0700)
Rely on wait_event_interruptible_timeout() to put the process to sleep
with TASK_INTERRUPTIBLE. It allows using this function in interruptible
context.

v2: Propagate error on wait_event_interruptible_timeout (Matt Brost)

Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809155156.1955925-3-francois.dugast@intel.com
drivers/gpu/drm/xe/xe_guc_submit.c

index be5b9d8cfa5fa51b6d0e64db004b8a78ca20fc8f..fbbe6a487bbb3bc7c5a14c82ead291c370990618 100644 (file)
@@ -1628,11 +1628,11 @@ static int guc_exec_queue_suspend_wait(struct xe_exec_queue *q)
         * suspend_pending upon kill but to be paranoid but races in which
         * suspend_pending is set after kill also check kill here.
         */
-       ret = wait_event_timeout(q->guc->suspend_wait,
-                                !READ_ONCE(q->guc->suspend_pending) ||
-                                exec_queue_killed(q) ||
-                                guc_read_stopped(guc),
-                                HZ * 5);
+       ret = wait_event_interruptible_timeout(q->guc->suspend_wait,
+                                              !READ_ONCE(q->guc->suspend_pending) ||
+                                              exec_queue_killed(q) ||
+                                              guc_read_stopped(guc),
+                                              HZ * 5);
 
        if (!ret) {
                xe_gt_warn(guc_to_gt(guc),
@@ -1642,7 +1642,7 @@ static int guc_exec_queue_suspend_wait(struct xe_exec_queue *q)
                return -ETIME;
        }
 
-       return 0;
+       return ret < 0 ? ret : 0;
 }
 
 static void guc_exec_queue_resume(struct xe_exec_queue *q)