diff options
author | Matthew Auld <matthew.auld@intel.com> | 2023-09-01 15:28:25 +0100 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:41:02 -0500 |
commit | fba153b0d0b769bb2379c9e78968036d17bdfb6b (patch) | |
tree | d419a5d04c5bf3f521fbc91b654b796858cc6b8a /drivers/gpu/drm | |
parent | 621fd7dc38b7c18d4946a05051f674fcab82d4dd (diff) |
drm/xe/selftests: consider multi-GT for eviction test
We need to sanitize and reset each GT, since xe_bo_evict_all() will
evict everything regardless of GT, which can leave other GTs in a broken
state.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/xe/tests/xe_bo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c index b32a9068d76c..0e4ec22c5667 100644 --- a/drivers/gpu/drm/xe/tests/xe_bo.c +++ b/drivers/gpu/drm/xe/tests/xe_bo.c @@ -181,7 +181,8 @@ static int evict_test_run_gt(struct xe_device *xe, struct xe_gt *gt, struct kuni XE_BO_CREATE_VRAM_IF_DGFX(gt_to_tile(gt)); struct xe_vm *vm = xe_migrate_get_vm(xe_device_get_root_tile(xe)->migrate); struct ww_acquire_ctx ww; - int err, i; + struct xe_gt *__gt; + int err, i, id; kunit_info(test, "Testing device %s gt id %u vram id %u\n", dev_name(xe->drm.dev), gt->info.id, gt_to_tile(gt)->id); @@ -218,7 +219,8 @@ static int evict_test_run_gt(struct xe_device *xe, struct xe_gt *gt, struct kuni goto cleanup_all; } - xe_gt_sanitize(gt); + for_each_gt(__gt, xe, id) + xe_gt_sanitize(__gt); err = xe_bo_restore_kernel(xe); /* * Snapshotting the CTB and copying back a potentially old @@ -231,8 +233,10 @@ static int evict_test_run_gt(struct xe_device *xe, struct xe_gt *gt, struct kuni * 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(>->reset.worker); + for_each_gt(__gt, xe, id) { + xe_gt_reset_async(__gt); + flush_work(&__gt->reset.worker); + } if (err) { KUNIT_FAIL(test, "restore kernel err=%pe\n", ERR_PTR(err)); |