Skip to content

Commit 65d046b

Browse files
sanjayumangThomas Hellström
authored andcommitted
drm/xe: Fix missing runtime PM reference in ccs_mode_store
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: 480b358 ("drm/xe: Do not wake device during a GT reset") Cc: <[email protected]> # v6.19+ Cc: Thomas Hellström <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Shuicheng Lin <[email protected]> Suggested-by: Matthew Auld <[email protected]> Signed-off-by: Sanjay Yadav <[email protected]> Reviewed-by: Shuicheng Lin <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Link: https://patch.msgid.link/[email protected] (cherry picked from commit 7937ea7) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 01f2557 commit 65d046b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_gt_ccs_mode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "xe_gt_printk.h"
1313
#include "xe_gt_sysfs.h"
1414
#include "xe_mmio.h"
15+
#include "xe_pm.h"
1516
#include "xe_sriov.h"
1617

1718
static void __xe_gt_apply_ccs_mode(struct xe_gt *gt, u32 num_engines)
@@ -150,6 +151,7 @@ ccs_mode_store(struct device *kdev, struct device_attribute *attr,
150151
xe_gt_info(gt, "Setting compute mode to %d\n", num_engines);
151152
gt->ccs_mode = num_engines;
152153
xe_gt_record_user_engines(gt);
154+
guard(xe_pm_runtime)(xe);
153155
xe_gt_reset(gt);
154156
}
155157

0 commit comments

Comments
 (0)