mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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: 188ced1e0f
("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: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240625094228.5327-1-nirmoy.das@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
This commit is contained in:
parent
f4efd274d9
commit
e71cf19e31
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user