Commit e71cf19e authored by Nirmoy Das's avatar Nirmoy Das Committed by Lucas De Marchi

drm/xe/client: Check return value of xe_force_wake_get

xe_force_wake_get() can return error so check it's return value
before reading gpu_timestamp value.

v2: set HWE to NULL instead of setting timestamp to 0(Lucas)
    Add a warn on for xe_force_wake_put(Himal)

Fixes: 188ced1e ("drm/xe/client: Print runtime to fdinfo")
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240625094228.5327-1-nirmoy.das@intel.comSigned-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
parent f4efd274
......@@ -264,9 +264,13 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
if (!hwe)
continue;
xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
if (xe_force_wake_get(gt_to_fw(gt), XE_FW_GT)) {
hwe = NULL;
break;
}
gpu_timestamp = xe_hw_engine_read_timestamp(hwe);
xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FW_GT));
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment