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,
	Priyanka Dandamudi <priyanka.dandamudi@intel.com>,
	Janga Rahul Kumar <janga.rahul.kumar@intel.com>
Subject: [PATCH i-g-t] tests/intel/xe_exec_fault_mode: Fix misuse of __xe_wait_ufence
Date: Fri, 19 Apr 2024 11:57:39 -0700	[thread overview]
Message-ID: <20240419185739.30993-1-brian.welty@intel.com> (raw)

When confirming that xe_exec() user_fences completed, this is performed
in a loop.  When using __xe_wait_ufence(), it returns an updated timeout
value to reflect how much time was remaining.  As side-effect, when calling
in a loop without resetting the timeout, the timeout value will get
progressively smaller over many iterations.
We don't want a smaller timeout to be used on each subsequent call to
__xe_wait_ufence(), so fix here is to reset the timeout inside the loop.
This issue is visible in simulation runs due to the slower execution time,
where later iterations of the wait are failing due to timeout being too
small.

Signed-off-by: Brian Welty <brian.welty@intel.com>
---
 tests/intel/xe_exec_fault_mode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_exec_fault_mode.c b/tests/intel/xe_exec_fault_mode.c
index 40fe1743e4..c0d082e7fa 100644
--- a/tests/intel/xe_exec_fault_mode.c
+++ b/tests/intel/xe_exec_fault_mode.c
@@ -273,11 +273,12 @@ test_exec(int fd, struct drm_xe_engine_class_instance *eci,
 		}
 	}
 	if (!(flags & INVALID_FAULT)) {
-		int64_t timeout = ONE_SEC;
+		int64_t timeout;
 
 		j = flags & INVALIDATE ? n_execs - 1 : 0;
 
 		for (i = j; i < n_execs; i++) {
+			timeout = ONE_SEC;
 			if (flags & INVALID_VA && !(flags & ENABLE_SCRATCH))
 				igt_assert_eq(__xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
 							       exec_queues[i % n_exec_queues], &timeout), -EIO);
-- 
2.43.0


             reply	other threads:[~2024-04-19 18:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 18:57 Brian Welty [this message]
2024-04-19 19:33 ` ✗ Fi.CI.BAT: failure for tests/intel/xe_exec_fault_mode: Fix misuse of __xe_wait_ufence Patchwork
2024-04-23 19:54   ` Kamil Konieczny
2024-04-19 21:35 ` ✓ CI.xeBAT: success " Patchwork
2024-04-23  4:36 ` [PATCH i-g-t] " Matt Roper

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=20240419185739.30993-1-brian.welty@intel.com \
    --to=brian.welty@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janga.rahul.kumar@intel.com \
    --cc=priyanka.dandamudi@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