Skip to content

Commit 9d271a4

Browse files
ShuichengLinlucasdemarchi
authored andcommitted
drm/xe: Release force wake first then runtime power
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 <[email protected]> Cc: Rodrigo Vivi <[email protected]> Signed-off-by: Shuicheng Lin <[email protected]> Reviewed-by: Himal Prasad Ghimiray <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit 432cd94efdca06296cc5e76d673546f58aa90ee1) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 03552d8 commit 9d271a4

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)