]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Fix missing runtime PM reference in ccs_mode_store
authorSanjay Yadav <sanjay.kumar.yadav@intel.com>
Fri, 13 Mar 2026 07:16:09 +0000 (12:46 +0530)
committerMatthew Auld <matthew.auld@intel.com>
Wed, 18 Mar 2026 11:59:39 +0000 (11:59 +0000)
ccs_mode_store() calls xe_gt_reset() which internally invokes
xe_pm_runtime_get_noresume(). That function requires the caller
to already hold an outer runtime PM reference and warns if none
is held:

  [46.891177] xe 0000:03:00.0: [drm] Missing outer runtime PM protection
  [46.891178] WARNING: drivers/gpu/drm/xe/xe_pm.c:885 at
  xe_pm_runtime_get_noresume+0x8b/0xc0

Fix this by protecting xe_gt_reset() with the scope-based
guard(xe_pm_runtime)(xe), which is the preferred form when
the reference lifetime matches a single scope.

v2:
- Use scope-based guard(xe_pm_runtime)(xe) (Shuicheng)
- Update commit message accordingly

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/7593
Fixes: 480b358e7d8e ("drm/xe: Do not wake device during a GT reset")
Cc: <stable@vger.kernel.org> # v6.19+
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Suggested-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com>
Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20260313071608.3459480-2-sanjay.kumar.yadav@intel.com
drivers/gpu/drm/xe/xe_gt_ccs_mode.c

index b35be36b0eaa2bd9e6b102b3789263c1aa0ea51b..baee1f4a6b013e080376c7d08624c355109d675c 100644 (file)
@@ -12,6 +12,7 @@
 #include "xe_gt_printk.h"
 #include "xe_gt_sysfs.h"
 #include "xe_mmio.h"
+#include "xe_pm.h"
 #include "xe_sriov.h"
 #include "xe_sriov_pf.h"
 
@@ -163,6 +164,7 @@ ccs_mode_store(struct device *kdev, struct device_attribute *attr,
        xe_gt_info(gt, "Setting compute mode to %d\n", num_engines);
        gt->ccs_mode = num_engines;
        xe_gt_record_user_engines(gt);
+       guard(xe_pm_runtime)(xe);
        xe_gt_reset(gt);
 
        /* We may end PF lockdown once CCS mode is default again */