Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/intel/xe_fault_injection: Injection list clear at exit
@ 2025-03-21  9:53 Marcin Bernatowicz
  2025-03-21 16:01 ` ✓ Xe.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Marcin Bernatowicz @ 2025-03-21  9:53 UTC (permalink / raw)
  To: igt-dev; +Cc: Marcin Bernatowicz, Francois Dugast, Lucas De Marchi,
	Rodrigo Vivi

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1297 bytes --]

Reintroduce clearing of the injection list as an exit handler to ensure
fault injections are properly cleaned up.

Fixes: c0b2d9202f78 ("tests/intel/xe_fault_injection: Use igt_sysfs helpers")

Cc: Francois Dugast <francois.dugast@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 tests/intel/xe_fault_injection.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 5409d19a6..1bd0f51a3 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -137,6 +137,12 @@ static void setup_injection_fault(void)
 	close(dir);
 }
 
+static void cleanup_injection_fault(int sig)
+{
+	/* If nothing specified (‘’) injection list is cleared */
+	injection_list_do(INJECTION_LIST_ADD, "");
+}
+
 static void set_retval(const char function_name[], long long retval)
 {
 	char path[96];
@@ -371,6 +377,7 @@ igt_main
 		fd = drm_open_driver(DRIVER_XE);
 		igt_device_get_pci_slot_name(fd, pci_slot);
 		setup_injection_fault();
+		igt_install_exit_handler(cleanup_injection_fault);
 	}
 
 	for (const struct section *s = vm_create_fail_functions; s->name; s++)
-- 
2.31.1


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

end of thread, other threads:[~2025-03-24 14:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-21  9:53 [PATCH i-g-t] tests/intel/xe_fault_injection: Injection list clear at exit Marcin Bernatowicz
2025-03-21 16:01 ` ✓ Xe.CI.BAT: success for " Patchwork
2025-03-21 16:16 ` ✓ i915.CI.BAT: " Patchwork
2025-03-21 17:12 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-24 13:31   ` Bernatowicz, Marcin
2025-03-24 13:58     ` Bernatowicz, Marcin
2025-03-21 18:57 ` ✗ i915.CI.Full: " Patchwork
2025-03-24 13:32   ` Bernatowicz, Marcin
2025-03-24 14:00 ` [PATCH i-g-t] " Kamil Konieczny
2025-03-24 14:36 ` Kamil Konieczny

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