Skip to content

Commit 4ebd119

Browse files
ShuichengLingregkh
authored andcommitted
drm/xe: Release force wake first then runtime power
[ Upstream commit 9d271a4 ] xe_force_wake_get() is dependent on xe_pm_runtime_get(), so for the release path, xe_force_wake_put() should be called first then xe_pm_runtime_put(). Combine the error path and normal path together with goto. Fixes: 85d5476 ("drm/xe/xe_gt_debugfs: Update handling of xe_force_wake_get return") Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://lore.kernel.org/r/20250507022302.2187527-1-shuicheng.lin@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 432cd94) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c12fe5d commit 4ebd119

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/gpu/drm/xe/xe_gt_debugfs.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,23 @@ static int hw_engines(struct xe_gt *gt, struct drm_printer *p)
9292
struct xe_hw_engine *hwe;
9393
enum xe_hw_engine_id id;
9494
unsigned int fw_ref;
95+
int ret = 0;
9596

9697
xe_pm_runtime_get(xe);
9798
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
9899
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) {
99-
xe_pm_runtime_put(xe);
100-
xe_force_wake_put(gt_to_fw(gt), fw_ref);
101-
return -ETIMEDOUT;
100+
ret = -ETIMEDOUT;
101+
goto fw_put;
102102
}
103103

104104
for_each_hw_engine(hwe, gt, id)
105105
xe_hw_engine_print(hwe, p);
106106

107+
fw_put:
107108
xe_force_wake_put(gt_to_fw(gt), fw_ref);
108109
xe_pm_runtime_put(xe);
109110

110-
return 0;
111+
return ret;
111112
}
112113

113114
static int powergate_info(struct xe_gt *gt, struct drm_printer *p)

0 commit comments

Comments
 (0)