[i-g-t 1/1] tests/intel/xe_exec_fault_mode: wait for the completion

fei.yang at intel.com fei.yang at intel.com
Fri Oct 25 00:23:22 UTC 2024


From: Fei Yang <fei.yang at intel.com>

The execution on GPU is out of order, the completion of the
last submission doesn't mean all the jobs are completed. We
need to make sure all the jobs are completed before moving
on to unbinding the buffer, otherwise the test would run
into CAT errors.

Signed-off-by: Fei Yang <fei.yang at intel.com>
---
 tests/intel/xe_exec_fault_mode.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_fault_mode.c b/tests/intel/xe_exec_fault_mode.c
index 9cc51b7d3..d416c773b 100644
--- a/tests/intel/xe_exec_fault_mode.c
+++ b/tests/intel/xe_exec_fault_mode.c
@@ -305,7 +305,15 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 		}
 	}
 	if (!(flags & INVALID_FAULT)) {
-		j = flags & INVALIDATE ? n_execs - 1 : 0;
+		/*
+		 * For !RACE cases xe_wait_ufence has already been called in above
+		 * for-loop, we should only wait for the completion of the last
+		 * submission here. For RACE cases we need to wait for all submissions
+		 * to complete because the GuC scheduling can be out of order, the
+		 * completion of the last submission doesn't mean all submission are
+		 * completed.
+		 */
+		j = (flags & INVALIDATE && !(flags & RACE)) ? n_execs - 1 : 0;
 
 		for (i = j; i < n_execs; i++) {
 			int64_t timeout = NSEC_PER_SEC;
-- 
2.25.1



More information about the igt-dev mailing list