Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6] drm/xe: Add helper function to inject fault into ct_dead_capture()
@ 2025-05-24 14:46 Satyanarayana K V P
  2025-05-24 14:35 ` ✓ CI.Patch_applied: success for drm/xe: Add helper function to inject fault into ct_dead_capture() (rev6) Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Satyanarayana K V P @ 2025-05-24 14:46 UTC (permalink / raw)
  To: intel-xe
  Cc: Satyanarayana K V P, John Harrison, Michal Wajdeczko, Jani Nikula

When injecting fault to xe_guc_ct_send_recv() & xe_guc_mmio_send_recv()
functions, the CI test systems are going out of space and crashing. To
avoid this issue, a new helper function is created and when fault is
injected into this xe_inject_fault() helper function, ct dead capture
is avoided which suppresses ct dumps in the log.

Signed-off-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com>
Suggested-by: John Harrison <John.C.Harrison@Intel.com>
---
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>

V5 -> V6:
- Fixed review comments.
- Updated helper function description.

V4 -> V5:
- Fixed review comments.

V3 -> V4:
- Updated the name of helper function and moved to xe_device.h file.

V2 -> V3:
- Added inline function to avoid compilation error in the absence of
CONFIG_FUNCTION_ERROR_INJECTION.

V1 -> V2:
- Fixed review comments.
---
 drivers/gpu/drm/xe/xe_device.h | 17 +++++++++++++++++
 drivers/gpu/drm/xe/xe_guc_ct.c |  6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index 0bc3bc8e6803..9dd31facc9d8 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -195,6 +195,23 @@ void xe_device_declare_wedged(struct xe_device *xe);
 struct xe_file *xe_file_get(struct xe_file *xef);
 void xe_file_put(struct xe_file *xef);
 
+#ifdef CONFIG_FUNCTION_ERROR_INJECTION
+/*
+ * This is a helper function which assists the driver in identifying if a fault
+ * injection test is currently active, allowing it to reduce unnecessary debug
+ * output. Typically, the function returns zero, but the fault injection
+ * framework can alter this to return an error. Since faults are injected
+ * through this function, it's important to ensure the compiler doesn't optimize
+ * it into an inline function. To avoid such optimization, the 'noinline'
+ * attribute is applied.
+ */
+
+static noinline int xe_is_injection_active(void) { return 0; }
+ALLOW_ERROR_INJECTION(xe_is_injection_active, ERRNO);
+#else
+static inline int xe_is_injection_active(void) { return 0; }
+#endif
+
 /*
  * Occasionally it is seen that the G2H worker starts running after a delay of more than
  * a second even after being queued and activated by the Linux workqueue subsystem. This
diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index 822f4c33f730..89f992feba31 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -2040,6 +2040,12 @@ static void ct_dead_capture(struct xe_guc_ct *ct, struct guc_ctb *ctb, u32 reaso
 
 	if (ctb)
 		ctb->info.broken = true;
+	/*
+	 * Huge dump is getting generated when injecting error for guc CT/MMIO
+	 * functions. So, let us suppress the dump when fault is injected.
+	 */
+	if (xe_is_injection_active())
+		return;
 
 	/* Ignore further errors after the first dump until a reset */
 	if (ct->dead.reported)
-- 
2.43.0


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

end of thread, other threads:[~2025-06-11  7:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-24 14:46 [PATCH v6] drm/xe: Add helper function to inject fault into ct_dead_capture() Satyanarayana K V P
2025-05-24 14:35 ` ✓ CI.Patch_applied: success for drm/xe: Add helper function to inject fault into ct_dead_capture() (rev6) Patchwork
2025-05-24 14:35 ` ✓ CI.checkpatch: " Patchwork
2025-05-24 14:37 ` ✓ CI.KUnit: " Patchwork
2025-05-24 14:47 ` ✓ CI.Build: " Patchwork
2025-05-24 14:49 ` ✓ CI.Hooks: " Patchwork
2025-05-24 14:51 ` ✓ CI.checksparse: " Patchwork
2025-05-24 15:12 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-24 23:52 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-05 20:04 ` [PATCH v6] drm/xe: Add helper function to inject fault into ct_dead_capture() John Harrison
2025-06-06 13:19   ` Jani Nikula
2025-06-07  0:06     ` John Harrison
2025-06-11  7:35       ` Jani Nikula

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