[PATCH i-g-t v2 2/2] tests/intel/xe_exec_fault_mode: account for EBUSY in support check

Jonathan Cavitt jonathan.cavitt at intel.com
Fri May 10 18:24:38 UTC 2024


It's possible for xe_supports_faults to return false if the system is
busy with multiple running tests.  This is because the check looks for
all active VMs and searches for VMs that do not have faults enabled,
returning false if any exist.  Recently, this check has been changed to
return EBUSY when the check fails in this way, so wait for up to two
seconds for all the active VMs to flush out before proceeding.

Signed-off-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
---
 tests/intel/xe_exec_fault_mode.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_fault_mode.c b/tests/intel/xe_exec_fault_mode.c
index 0b3f4cb8de..4f55756e92 100644
--- a/tests/intel/xe_exec_fault_mode.c
+++ b/tests/intel/xe_exec_fault_mode.c
@@ -406,8 +406,18 @@ igt_main
 	int fd;
 
 	igt_fixture {
+		struct timespec tv = {};
+		bool supports_faults;
+		int ret;
+		int timeout = igt_run_in_simulation() ? 20 : 2;
+
 		fd = drm_open_driver(DRIVER_XE);
-		igt_require(xe_supports_faults(fd));
+		do {
+			ret = xe_supports_faults(fd);
+		} while (ret == -EBUSY && igt_seconds_elapsed(&tv) < timeout);
+
+		supports_faults = !ret;
+		igt_require(supports_faults);
 	}
 
 	for (const struct section *s = sections; s->name; s++) {
-- 
2.25.1



More information about the igt-dev mailing list