Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Welty <brian.welty@intel.com>
To: igt-dev@lists.freedesktop.org, Pallavi Mishra <pallavi.mishra@intel.com>
Subject: [igt-dev] [PATCH i-g-t v2 2/2] tests/intel/xe_exec_reset: Fix cm-gt-reset
Date: Mon,  4 Dec 2023 11:43:06 -0800	[thread overview]
Message-ID: <20231204194306.12950-3-brian.welty@intel.com> (raw)
In-Reply-To: <20231204194306.12950-1-brian.welty@intel.com>

With use of GT_RESET and forcing GT reset, it is expected for the
xe_wait_ufence to expire. Move the assertion checking into the IGT
by using __xe_wait_ufence().
In addition, we cannot validate the exec operation was successful
for GT_RESET case.

Signed-off-by: Brian Welty <brian.welty@intel.com>
---
 tests/intel/xe_exec_reset.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/tests/intel/xe_exec_reset.c b/tests/intel/xe_exec_reset.c
index 195e62911f..d322cf4bdd 100644
--- a/tests/intel/xe_exec_reset.c
+++ b/tests/intel/xe_exec_reset.c
@@ -612,16 +612,27 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,
 		return;
 	}
 
-	for (i = 1; i < n_execs; i++)
-		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
-			       NULL, THREE_SEC);
+	for (i = 1; i < n_execs; i++) {
+		int64_t timeout = THREE_SEC;
+		int err;
+
+		err = __xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
+				       NULL, &timeout);
+		if (flags & GT_RESET)
+			/* exec races with reset: may timeout or complete */
+			igt_assert(err == -ETIME || !err);
+		else
+			igt_assert_eq(err, 0);
+	}
 
 	sync[0].addr = to_user_pointer(&data[0].vm_sync);
 	xe_vm_unbind_async(fd, vm, 0, 0, addr, bo_size, sync, 1);
 	xe_wait_ufence(fd, &data[0].vm_sync, USER_FENCE_VALUE, NULL, THREE_SEC);
 
-	for (i = 1; i < n_execs; i++)
-		igt_assert_eq(data[i].data, 0xc0ffee);
+	if (!(flags & GT_RESET)) {
+		for (i = 1; i < n_execs; i++)
+			igt_assert_eq(data[i].data, 0xc0ffee);
+	}
 
 	for (i = 0; i < n_exec_queues; i++)
 		xe_exec_queue_destroy(fd, exec_queues[i]);
-- 
2.38.0

  parent reply	other threads:[~2023-12-04 19:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 19:43 [igt-dev] [PATCH i-g-t v2 0/2] Fix xe_exec_reset@cm-gt-reset Brian Welty
2023-12-04 19:43 ` [igt-dev] [PATCH i-g-t v2 1/2] lib/xe_ioctl: Add __xe_wait_ufence() Brian Welty
2023-12-04 20:38   ` Kamil Konieczny
2023-12-05 19:21     ` Welty, Brian
2023-12-06 18:02       ` Kamil Konieczny
2023-12-04 19:43 ` Brian Welty [this message]
2023-12-04 20:38   ` [igt-dev] [PATCH i-g-t v2 2/2] tests/intel/xe_exec_reset: Fix cm-gt-reset Mishra, Pallavi
2023-12-04 20:40   ` Kamil Konieczny
2023-12-04 21:12 ` [igt-dev] ✓ CI.xeBAT: success for Fix xe_exec_reset@cm-gt-reset (rev2) Patchwork
2023-12-04 21:19 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-12-05  3:08 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-12-05 19:51 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Fix xe_exec_reset@cm-gt-reset (rev3) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231204194306.12950-3-brian.welty@intel.com \
    --to=brian.welty@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=pallavi.mishra@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox