aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirmoy Das <[email protected]>2024-06-25 11:42:28 +0200
committerLucas De Marchi <[email protected]>2024-06-27 11:56:11 -0700
commite71cf19e3119de446cc37ddabb2e161ebbf7357c (patch)
tree32b445ee4554ee8c20a60b09a297c8eb58c511c7
parentf4efd274d93b5000efc58bbfa14f8f863a57642d (diff)
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: 188ced1e0ff8 ("drm/xe/client: Print runtime to fdinfo") Cc: Himal Prasad Ghimiray <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Rodrigo Vivi <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Lucas De Marchi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_drm_client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
index 4a19b771e3a0..4bdb909eabfc 100644
--- a/drivers/gpu/drm/xe/xe_drm_client.c
+++ b/drivers/gpu/drm/xe/xe_drm_client.c
@@ -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;
}