Skip to content

Commit 85d5476

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe/xe_gt_debugfs: Update handling of xe_force_wake_get return
With xe_force_wake_get() now returning the refcount-incremented domain mask, a non-zero return value in the case of XE_FORCEWAKE_ALL does not necessarily indicate success. Use xe_force_wake_ref_has_domain() determine the status of the call. Modify the return handling of xe_force_wake_get() accordingly and pass the return value to xe_force_wake_put(). v3 - return xe_wakeref_t instead of int in xe_force_wake_get() - xe_force_wake_put() error doesn't need to be checked. It internally WARNS on domain ack failure. v5 - return unsigned int for xe_force_wake_get() v6 - use helper xe_force_wake_ref_has_domain() Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 7fe17fa commit 85d5476

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/gpu/drm/xe/xe_gt_debugfs.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,21 @@ static int hw_engines(struct xe_gt *gt, struct drm_printer *p)
9090
struct xe_device *xe = gt_to_xe(gt);
9191
struct xe_hw_engine *hwe;
9292
enum xe_hw_engine_id id;
93-
int err;
93+
unsigned int fw_ref;
9494

9595
xe_pm_runtime_get(xe);
96-
err = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
97-
if (err) {
96+
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL);
97+
if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) {
9898
xe_pm_runtime_put(xe);
99-
return err;
99+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
100+
return -ETIMEDOUT;
100101
}
101102

102103
for_each_hw_engine(hwe, gt, id)
103104
xe_hw_engine_print(hwe, p);
104105

105-
err = xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL);
106+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
106107
xe_pm_runtime_put(xe);
107-
if (err)
108-
return err;
109108

110109
return 0;
111110
}

0 commit comments

Comments
 (0)