Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH] xe_exec_reset: Fix cm-gt-reset for LR job behavior
Date: Tue,  8 Aug 2023 15:27:10 -0700	[thread overview]
Message-ID: <20230808222710.13503-1-matthew.brost@intel.com> (raw)

Long running jobs in Xe are not recoverable even if the job did not
trigger the GT reset due to DRM scheduler not tracking LR jobs. Update
cm-gt-reset to understand all LR jobs are lost after a GT reset.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 tests/xe/xe_exec_reset.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/xe/xe_exec_reset.c b/tests/xe/xe_exec_reset.c
index dfbaa6035..e8faf6209 100644
--- a/tests/xe/xe_exec_reset.c
+++ b/tests/xe/xe_exec_reset.c
@@ -622,8 +622,10 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,
 		xe_exec(fd, &exec);
 	}
 
-	if (flags & GT_RESET)
+	if (flags & GT_RESET) {
 		xe_force_gt_reset(fd, eci->gt_id);
+		usleep(150000);	/* Let GT reset soak */
+	}
 
 	if (flags & CLOSE_FD) {
 		if (flags & CLOSE_ENGINES) {
@@ -636,7 +638,7 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,
 		return;
 	}
 
-	for (i = 1; i < n_execs; i++)
+	for (i = 1; i < n_execs && !(flags & GT_RESET); i++)
 		xe_wait_ufence(fd, &data[i].exec_sync, USER_FENCE_VALUE,
 			       NULL, THREE_SEC);
 
@@ -644,7 +646,7 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,
 	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++)
+	for (i = 1; i < n_execs && !(flags & GT_RESET); i++)
 		igt_assert_eq(data[i].data, 0xc0ffee);
 
 	for (i = 0; i < n_engines; i++)
-- 
2.34.1

             reply	other threads:[~2023-08-08 22:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08 22:27 Matthew Brost [this message]
2023-08-08 23:21 ` [igt-dev] ✓ Fi.CI.BAT: success for xe_exec_reset: Fix cm-gt-reset for LR job behavior Patchwork
2023-08-09  2:50 ` [igt-dev] ○ CI.xeBAT: info " Patchwork
2023-08-09 12:09 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-08-23 19:45 ` [igt-dev] [PATCH] " Rodrigo Vivi

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=20230808222710.13503-1-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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