Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t v3] tests/intel/xe_exec_fault_mode: Don't return early
@ 2024-08-28  9:55 Nirmoy Das
  2024-08-28 11:15 ` ✗ CI.xeBAT: failure for tests/intel/xe_exec_fault_mode: Don't return early (rev3) Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Nirmoy Das @ 2024-08-28  9:55 UTC (permalink / raw)
  To: igt-dev
  Cc: kamil.konieczny, Nirmoy Das, Andrzej Hajda, Matthew Brost,
	Tejas Upadhyay

Tests that are causing pagefaults should wait for exec queue to be ban
otherwise pending engine resets because of on-going pagefaults would
cause failure in subsequent tests to fail.

Set a larger 5 sec timeout if still tests fail, we can blame
driver in such case.

v2: specify timeout reason and iterate over exec_queues(Andrzej)
v3: increase timeout

Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1630
Reviewed-by: Matthew Brost <matthew.brost@intel.com> #v1
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 tests/intel/xe_exec_fault_mode.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tests/intel/xe_exec_fault_mode.c b/tests/intel/xe_exec_fault_mode.c
index 1f1f1e50b..e3e6047e7 100644
--- a/tests/intel/xe_exec_fault_mode.c
+++ b/tests/intel/xe_exec_fault_mode.c
@@ -36,6 +36,22 @@
 #define INVALID_VA	(0x1 << 8)
 #define ENABLE_SCRATCH  (0x1 << 9)
 
+static int get_ban_property(int xe, struct drm_xe_engine_class_instance *eci,
+			    uint32_t vm, uint32_t exec_queue)
+{
+	struct drm_xe_exec_queue_get_property args = {
+		.value = -1,
+		.reserved[0] = 0,
+		.property = DRM_XE_EXEC_QUEUE_GET_PROPERTY_BAN,
+	};
+
+	args.exec_queue_id = exec_queue;
+
+	do_ioctl(xe, DRM_IOCTL_XE_EXEC_QUEUE_GET_PROPERTY, &args);
+
+	return args.value;
+}
+
 /**
  * SUBTEST: invalid-va
  * Description: Access invalid va and check for EIO through user fence.
@@ -324,6 +340,15 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE,
 		       bind_exec_queues[0], NSEC_PER_SEC);
 
+	if ((flags & INVALID_FAULT)) {
+		igt_set_timeout(5, "waiting for ban");
+		for (i = 0; i < n_exec_queues; i++) {
+			while (!get_ban_property(fd, eci, vm, exec_queues[i]))
+				sched_yield();
+		}
+		igt_reset_timeout();
+	}
+
 	if (!(flags & INVALID_FAULT) && !(flags & INVALID_VA)) {
 		for (i = j; i < n_execs; i++)
 				igt_assert_eq(data[i].data, 0xc0ffee);
-- 
2.42.0


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

end of thread, other threads:[~2024-08-30  9:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28  9:55 [PATCH i-g-t v3] tests/intel/xe_exec_fault_mode: Don't return early Nirmoy Das
2024-08-28 11:15 ` ✗ CI.xeBAT: failure for tests/intel/xe_exec_fault_mode: Don't return early (rev3) Patchwork
2024-08-28 11:26 ` ✗ Fi.CI.BAT: " Patchwork
2024-08-28 12:45 ` ✓ CI.xeBAT: success for tests/intel/xe_exec_fault_mode: Don't return early (rev4) Patchwork
2024-08-28 12:51 ` ✓ Fi.CI.BAT: " Patchwork
2024-08-28 15:15 ` [PATCH i-g-t v3] tests/intel/xe_exec_fault_mode: Don't return early Andrzej Hajda
2024-08-28 15:26   ` Nirmoy Das
2024-08-30  9:12   ` Nirmoy Das
2024-08-28 17:12 ` ✗ CI.xeFULL: failure for tests/intel/xe_exec_fault_mode: Don't return early (rev3) Patchwork
2024-08-28 19:35 ` ✗ CI.xeFULL: failure for tests/intel/xe_exec_fault_mode: Don't return early (rev4) Patchwork
2024-08-29 12:18 ` ✗ Fi.CI.IGT: " Patchwork

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