Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 i-g-t] tests/intel/xe_fault_injection: Do not treat probe success as error
@ 2025-03-27 12:50 Marcin Bernatowicz
  2025-03-27 18:05 ` ✓ Xe.CI.BAT: success for tests/intel/xe_fault_injection: Do not treat probe success as error (rev2) Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Marcin Bernatowicz @ 2025-03-27 12:50 UTC (permalink / raw)
  To: igt-dev
  Cc: Marcin Bernatowicz, Francois Dugast, Lucas De Marchi,
	Rodrigo Vivi, Satyanarayana K V P

Certain functions may not be called at all, such as xe_wopcm_init,
xe_guc_log_init, and xe_guc_ads_init during VF probe.
In such cases, a successful probe should not be treated as an error.

v2: Use igt_kmod_unbind instead of xe_sysfs_driver_do.

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

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 24c114ba7..b4ce8972d 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -185,6 +185,8 @@ static void set_retval(const char function_name[], long long retval)
 static void
 inject_fault_probe(int fd, char pci_slot[], const char function_name[])
 {
+	int err = 0;
+
 	igt_info("Injecting error \"%s\" (%d) in function \"%s\"\n",
 		 strerror(-INJECT_ERRNO), INJECT_ERRNO, function_name);
 
@@ -192,8 +194,12 @@ inject_fault_probe(int fd, char pci_slot[], const char function_name[])
 	injection_list_do(INJECTION_LIST_ADD, function_name);
 	set_retval(function_name, INJECT_ERRNO);
 	xe_sysfs_driver_do(fd, pci_slot, XE_SYSFS_DRIVER_TRY_BIND);
-	igt_assert_eq(-errno, INJECT_ERRNO);
+	err = -errno;
 	injection_list_do(INJECTION_LIST_REMOVE, function_name);
+	if (err)
+		igt_assert_eq(err, INJECT_ERRNO);
+	else
+		igt_kmod_unbind("xe", pci_slot);
 }
 
 /**
-- 
2.31.1


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

end of thread, other threads:[~2025-04-06 16:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27 12:50 [PATCH v2 i-g-t] tests/intel/xe_fault_injection: Do not treat probe success as error Marcin Bernatowicz
2025-03-27 18:05 ` ✓ Xe.CI.BAT: success for tests/intel/xe_fault_injection: Do not treat probe success as error (rev2) Patchwork
2025-03-27 18:17 ` ✓ i915.CI.BAT: " Patchwork
2025-03-27 21:16 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-28  4:15 ` ✗ Xe.CI.Full: " Patchwork
2025-03-28 12:33 ` Patchwork
2025-04-06 16:54 ` ✓ Xe.CI.Full: success " Patchwork

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