public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: suppress GuC error logs when device is wedged
@ 2026-04-20 11:29 Sk Anirban
  2026-04-20 19:51 ` Summers, Stuart
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Sk Anirban @ 2026-04-20 11:29 UTC (permalink / raw)
  To: intel-xe
  Cc: anshuman.gupta, badal.nilawar, riana.tauro, karthik.poosa,
	raag.jadav, soham.purkait, mallesh.koujalagi, vinay.belgaumkar,
	Sk Anirban

When the device is wedged, GuC CT sends return -ECANCELED. This is
expected behavior, not an actionable error. Avoid logging these as
errors in the engine activity and power profile code paths.

Signed-off-by: Sk Anirban <sk.anirban@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_engine_activity.c | 8 +++++---
 drivers/gpu/drm/xe/xe_guc_engine_activity.h | 2 +-
 drivers/gpu/drm/xe/xe_guc_pc.c              | 4 ++--
 drivers/gpu/drm/xe/xe_uc.c                  | 5 ++++-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.c b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
index 2b99c1ebdd58..700f3464fb63 100644
--- a/drivers/gpu/drm/xe/xe_guc_engine_activity.c
+++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.c
@@ -464,18 +464,20 @@ int xe_guc_engine_activity_function_stats(struct xe_guc *guc, int num_vfs, bool
  *
  * Enable engine activity stats and set initial timestamps
  */
-void xe_guc_engine_activity_enable_stats(struct xe_guc *guc)
+int xe_guc_engine_activity_enable_stats(struct xe_guc *guc)
 {
 	int ret;
 
 	if (!xe_guc_engine_activity_supported(guc))
-		return;
+		return 0;
 
 	ret = enable_engine_activity_stats(guc);
-	if (ret)
+	if (ret && !(xe_device_wedged(guc_to_xe(guc)) && ret == -ECANCELED))
 		xe_gt_err(guc_to_gt(guc), "failed to enable activity stats%d\n", ret);
 	else
 		engine_activity_set_cpu_ts(guc, 0);
+
+	return ret;
 }
 
 static void engine_activity_fini(void *arg)
diff --git a/drivers/gpu/drm/xe/xe_guc_engine_activity.h b/drivers/gpu/drm/xe/xe_guc_engine_activity.h
index b32926c2d208..188f325a462d 100644
--- a/drivers/gpu/drm/xe/xe_guc_engine_activity.h
+++ b/drivers/gpu/drm/xe/xe_guc_engine_activity.h
@@ -13,7 +13,7 @@ struct xe_guc;
 
 int xe_guc_engine_activity_init(struct xe_guc *guc);
 bool xe_guc_engine_activity_supported(struct xe_guc *guc);
-void xe_guc_engine_activity_enable_stats(struct xe_guc *guc);
+int xe_guc_engine_activity_enable_stats(struct xe_guc *guc);
 int xe_guc_engine_activity_function_stats(struct xe_guc *guc, int num_vfs, bool enable);
 u64 xe_guc_engine_activity_active_ticks(struct xe_guc *guc, struct xe_hw_engine *hwe,
 					unsigned int fn_id);
diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index 7ecd91ad6192..efcd432ef6ef 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -1202,7 +1202,7 @@ int xe_guc_pc_set_power_profile(struct xe_guc_pc *pc, const char *buf)
 	ret = pc_action_set_param(pc,
 				  SLPC_PARAM_POWER_PROFILE,
 				  val);
-	if (ret)
+	if (ret && !(xe_device_wedged(pc_to_xe(pc)) && ret == -ECANCELED))
 		xe_gt_err_once(pc_to_gt(pc), "Failed to set power profile to %d: %pe\n",
 			       val, ERR_PTR(ret));
 	else
@@ -1306,7 +1306,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)
 
 	/* Set cached value of power_profile */
 	ret = xe_guc_pc_set_power_profile(pc, power_profile_to_string(pc));
-	if (unlikely(ret))
+	if (ret && !(xe_device_wedged(xe) && ret == -ECANCELED))
 		xe_gt_err(gt, "Failed to set SLPC power profile: %pe\n", ERR_PTR(ret));
 
 	return ret;
diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
index 75091bde0d50..b440cf8c431d 100644
--- a/drivers/gpu/drm/xe/xe_uc.c
+++ b/drivers/gpu/drm/xe/xe_uc.c
@@ -215,7 +215,10 @@ int xe_uc_load_hw(struct xe_uc *uc)
 	if (ret)
 		return ret;
 
-	xe_guc_engine_activity_enable_stats(&uc->guc);
+	ret = xe_guc_engine_activity_enable_stats(&uc->guc);
+
+	if (xe_device_wedged(guc_to_xe(&uc->guc)) && ret == -ECANCELED)
+		return ret;
 
 	/* We don't fail the driver load if HuC fails to auth */
 	ret = xe_huc_auth(&uc->huc, XE_HUC_AUTH_VIA_GUC);
-- 
2.43.0


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

end of thread, other threads:[~2026-04-29 19:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 11:29 [PATCH] drm/xe/guc: suppress GuC error logs when device is wedged Sk Anirban
2026-04-20 19:51 ` Summers, Stuart
2026-04-21 15:44   ` Anirban, Sk
2026-04-21 17:23     ` Michal Wajdeczko
2026-04-29 19:12       ` Anirban, Sk
2026-04-20 23:23 ` ✓ CI.KUnit: success for " Patchwork
2026-04-21  0:10 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-21  2:54 ` ✗ Xe.CI.FULL: failure " Patchwork

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