[PATCH] drm/xe: Always check force_wake_get return code

Tejas Upadhyay tejas.upadhyay at intel.com
Mon Jun 3 11:30:05 UTC 2024


A force_wake_get failure means that the HW might not be awake for the
access we're doing; this can lead to an immediate error or it can be a
more subtle problem.

In this case, user has asked information and in case of forcewake
failure, it might lead to wrong information, so return in case of
error.

Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
---
 drivers/gpu/drm/xe/xe_drm_client.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
index 4a19b771e3a0..e050fc6d8dd7 100644
--- a/drivers/gpu/drm/xe/xe_drm_client.c
+++ b/drivers/gpu/drm/xe/xe_drm_client.c
@@ -264,7 +264,8 @@ 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))
+			return;
 		gpu_timestamp = xe_hw_engine_read_timestamp(hwe);
 		xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 		break;
-- 
2.25.1



More information about the Intel-xe mailing list