Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/client: Check return value of  xe_force_wake_get
@ 2024-05-28 10:11 Nirmoy Das
  2024-05-28 10:32 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (15 more replies)
  0 siblings, 16 replies; 22+ messages in thread
From: Nirmoy Das @ 2024-05-28 10:11 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Lucas De Marchi

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

Fixes: 188ced1e0ff8 ("drm/xe/client: Print runtime to fdinfo")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/xe_drm_client.c | 6 ++++--
 1 file changed, 4 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..0c13395ffd34 100644
--- a/drivers/gpu/drm/xe/xe_drm_client.c
+++ b/drivers/gpu/drm/xe/xe_drm_client.c
@@ -245,7 +245,7 @@ static void show_run_ticks(struct drm_printer *p, struct drm_file *file)
 	struct xe_gt *gt;
 	struct xe_hw_engine *hwe;
 	struct xe_exec_queue *q;
-	u64 gpu_timestamp;
+	u64 gpu_timestamp = 0;
 
 	xe_pm_runtime_get(xe);
 
@@ -264,7 +264,9 @@ 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))
+			break;
+
 		gpu_timestamp = xe_hw_engine_read_timestamp(hwe);
 		xe_force_wake_put(gt_to_fw(gt), XE_FW_GT);
 		break;
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-05-30 21:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 10:11 [PATCH] drm/xe/client: Check return value of xe_force_wake_get Nirmoy Das
2024-05-28 10:32 ` ✓ CI.Patch_applied: success for " Patchwork
2024-05-28 10:32 ` ✓ CI.checkpatch: " Patchwork
2024-05-28 10:33 ` ✗ CI.KUnit: failure " Patchwork
2024-05-28 17:22 ` [PATCH] " Rodrigo Vivi
2024-05-29  8:50   ` Nirmoy Das
2024-05-29 13:37     ` Rodrigo Vivi
2024-05-29 16:24     ` Lucas De Marchi
2024-05-30 21:22       ` Nirmoy Das
2024-05-29  9:20 ` ✓ CI.Patch_applied: success for drm/xe/client: Check return value of xe_force_wake_get (rev2) Patchwork
2024-05-29  9:20 ` ✓ CI.checkpatch: " Patchwork
2024-05-29  9:21 ` ✗ CI.KUnit: failure " Patchwork
2024-05-29 10:29 ` ✓ CI.Patch_applied: success for drm/xe/client: Check return value of xe_force_wake_get (rev3) Patchwork
2024-05-29 10:29 ` ✓ CI.checkpatch: " Patchwork
2024-05-29 10:30 ` ✓ CI.KUnit: " Patchwork
2024-05-29 10:42 ` ✓ CI.Build: " Patchwork
2024-05-29 10:42 ` ✗ CI.Hooks: failure " Patchwork
2024-05-29 10:43 ` ✓ CI.checksparse: success " Patchwork
2024-05-29 11:08 ` ✓ CI.BAT: " Patchwork
2024-05-29 12:25 ` ✗ CI.FULL: failure " Patchwork
2024-05-30  8:47 ` [PATCH] drm/xe/client: Check return value of xe_force_wake_get Ghimiray, Himal Prasad
2024-05-30 21:30   ` Nirmoy Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox