Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Nirmoy Das <nirmoy.das@intel.com>
Subject: [Intel-xe] [PATCH v2 3/4] drm/xe/selftests: restart GT after xe_bo_restore_kernel()
Date: Mon, 17 Jul 2023 14:32:03 +0100	[thread overview]
Message-ID: <20230717133159.47980-9-matthew.auld@intel.com> (raw)
In-Reply-To: <20230717133159.47980-6-matthew.auld@intel.com>

Test seems to be failing badly after calling xe_bo_restore_kernel().
Taking a snapshot of the CTB and copying back a potentially old version
seems risky, depending on what might have been inflight. Also it seems
snapshotting the ADS object and copying back results in serious
breakage. Normally when calling xe_bo_restore_kernel() we always fully
restart the GT, which re-intializes such things.  We could potentially
skip saving and restoring such objects in xe_bo_evict_all() however
seems quite fragile not to also restart the GT. Try to do that here by
triggering a GT reset.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Acked-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/xe/tests/xe_bo.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c
index 6aad1443b00e..21c6dfef8dc7 100644
--- a/drivers/gpu/drm/xe/tests/xe_bo.c
+++ b/drivers/gpu/drm/xe/tests/xe_bo.c
@@ -220,7 +220,21 @@ static int evict_test_run_gt(struct xe_device *xe, struct xe_gt *gt, struct kuni
 			goto cleanup_all;
 		}
 
+		xe_gt_sanitize(gt);
 		err = xe_bo_restore_kernel(xe);
+		/*
+		 * Snapshotting the CTB and copying back a potentially old
+		 * version seems risky, depending on what might have been
+		 * inflight. Also it seems snapshotting the ADS object and
+		 * copying back results in serious breakage. Normally when
+		 * calling xe_bo_restore_kernel() we always fully restart the
+		 * GT, which re-intializes such things.  We could potentially
+		 * skip saving and restoring such objects in xe_bo_evict_all()
+		 * however seems quite fragile not to also restart the GT. Try
+		 * to do that here by triggering a GT reset.
+		 */
+		xe_gt_reset_async(gt);
+		flush_work(&gt->reset.worker);
 		if (err) {
 			KUNIT_FAIL(test, "restore kernel err=%pe\n",
 				   ERR_PTR(err));
-- 
2.41.0


  parent reply	other threads:[~2023-07-17 13:32 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 13:32 [Intel-xe] [PATCH v2 0/4] xe_bo selftest fixes Matthew Auld
2023-07-17 13:32 ` [Intel-xe] [PATCH v2 1/4] drm/xe/selftests: hold rpm for evict_test_run_device() Matthew Auld
2023-07-17 13:32 ` [Intel-xe] [PATCH v2 2/4] drm/xe/selftests: hold rpm for ccs_test_migrate() Matthew Auld
2023-07-17 13:32 ` Matthew Auld [this message]
2023-07-17 13:32 ` [Intel-xe] [PATCH v2 4/4] drm/xe: add missing bulk_move reset Matthew Auld
2023-07-17 13:54 ` [Intel-xe] ✓ CI.Patch_applied: success for xe_bo selftest fixes Patchwork
2023-07-17 13:54 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-07-17 13:56 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-07-17 13:59 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-17 14:00 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-17 14:01 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-18 10:46 ` [Intel-xe] ✓ CI.Patch_applied: success for xe_bo selftest fixes (rev2) Patchwork
2023-07-18 10:46 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-07-18 10:48 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-07-18 10:51 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-18 10:52 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-18 10:53 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-18 11:40 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-07-19  8:09 ` [Intel-xe] ✓ CI.Patch_applied: success for xe_bo selftest fixes (rev3) Patchwork
2023-07-19  8:10 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-07-19  8:11 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-07-19  8:15 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-07-19  8:15 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-07-19  8:16 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-07-19  8:50 ` [Intel-xe] ○ CI.BAT: info " 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=20230717133159.47980-9-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=nirmoy.das@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