drm/xe/debugfs: Get a runtime_pm reference when setting wedged mode
authorFrancois Dugast <francois.dugast@intel.com>
Fri, 3 May 2024 08:24:50 +0000 (10:24 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 3 May 2024 12:54:32 +0000 (08:54 -0400)
This function is another entry point where it must be ensured that
the device resumes before operating on the GuC, so grab a runtime_pm
reference. This fixes inner xe_pm_runtime_get_noresume calls which
were previously failing.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503082450.268335-1-francois.dugast@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_debugfs.c

index 98e3fbde50eabb30e221ea081e62250f42d0f002..2c060a0d62512b1cef75056eccd4e57dfaa9deb7 100644 (file)
@@ -153,6 +153,7 @@ static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
 
        xe->wedged.mode = wedged_mode;
 
+       xe_pm_runtime_get(xe);
        for_each_gt(gt, xe, id) {
                ret = xe_guc_ads_scheduler_policy_toggle_reset(&gt->uc.guc.ads);
                if (ret) {
@@ -160,6 +161,7 @@ static ssize_t wedged_mode_set(struct file *f, const char __user *ubuf,
                        return -EIO;
                }
        }
+       xe_pm_runtime_put(xe);
 
        return size;
 }