Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] tests/xe_fault_injection: Skip OA test if Xe OA interface is not available
@ 2025-04-23 12:52 Marcin Bernatowicz
  2025-04-23 22:28 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Marcin Bernatowicz @ 2025-04-23 12:52 UTC (permalink / raw)
  To: igt-dev
  Cc: Marcin Bernatowicz, Ashutosh Dixit, Jakub Kolakowski,
	Nakshtra Goyal

Handle the case where the Xe OA interface is not available by checking
for ENODEV and skipping the test gracefully. This avoids test failures
on platforms where the OA feature is not supported.

No functional change to platforms where the interface is present.

Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
Cc: Nakshtra Goyal <nakshtra.goyal@intel.com>
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
---
 tests/intel/xe_fault_injection.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_fault_injection.c b/tests/intel/xe_fault_injection.c
index 24d3df572..42b467e73 100644
--- a/tests/intel/xe_fault_injection.c
+++ b/tests/intel/xe_fault_injection.c
@@ -349,6 +349,7 @@ oa_add_config_fail(int fd, int sysfs, int devid, const char function_name[])
 	uint32_t mux_regs[] = { SAMPLE_MUX_REG, 0x0 };
 	struct drm_xe_oa_config config;
 	const char *uuid = "01234567-0123-0123-0123-0123456789ab";
+	int ret;
 
 	snprintf(path, sizeof(path), "metrics/%s/id", uuid);
 	/* Destroy previous configuration if present */
@@ -361,7 +362,10 @@ oa_add_config_fail(int fd, int sysfs, int devid, const char function_name[])
 	config.n_regs = 1;
 	config.regs_ptr = to_user_pointer(mux_regs);
 
-	igt_assert_lt(0, intel_xe_perf_ioctl(fd, DRM_XE_OBSERVATION_OP_ADD_CONFIG, &config));
+	ret = intel_xe_perf_ioctl(fd, DRM_XE_OBSERVATION_OP_ADD_CONFIG, &config);
+	igt_skip_on_f(ret == -1 && errno == ENODEV, "Xe OA interface not available\n");
+
+	igt_assert_lt(0, ret);
 	igt_assert(igt_sysfs_scanf(sysfs, path, "%" PRIu64, &config_id) == 1);
 	igt_assert_eq(intel_xe_perf_ioctl(fd, DRM_XE_OBSERVATION_OP_REMOVE_CONFIG, &config_id), 0);
 
-- 
2.31.1


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

end of thread, other threads:[~2025-04-25  9:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23 12:52 [PATCH i-g-t] tests/xe_fault_injection: Skip OA test if Xe OA interface is not available Marcin Bernatowicz
2025-04-23 22:28 ` ✓ i915.CI.BAT: success for " Patchwork
2025-04-24  2:42 ` ✓ i915.CI.Full: " Patchwork
2025-04-24  4:45 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-24 10:03 ` [PATCH i-g-t] " Goyal, Nakshtra
2025-04-24 19:51 ` ✗ Xe.CI.Full: failure for " Patchwork
2025-04-25  9:56   ` Bernatowicz, Marcin

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