Skip to content

Commit 0647ece

Browse files
committed
drm/i915/selftests: Fix engine reset count storage for multi-tile
Engine->id namespace is per-tile so struct igt_live_test->reset_engine[] needs to be two-dimensional so engine reset counts from all tiles can be stored with no aliasing. With aliasing, if we had a real multi-tile platform, the reset counts would be incorrect for same engine instance on different tiles. Signed-off-by: Tvrtko Ursulin <[email protected]> Fixes: 0c29efa ("drm/i915/selftests: Consider multi-gt instead of to_gt()") Reported-by: Alan Previn Teres Alexis <[email protected]> Cc: Tejas Upadhyay <[email protected]> Cc: Andi Shyti <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 706785c commit 0647ece

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

drivers/gpu/drm/i915/selftests/igt_live_test.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ int igt_live_test_begin(struct igt_live_test *t,
3737
}
3838

3939
for_each_engine(engine, gt, id)
40-
t->reset_engine[id] =
41-
i915_reset_engine_count(&i915->gpu_error, engine);
40+
t->reset_engine[i][id] =
41+
i915_reset_engine_count(&i915->gpu_error,
42+
engine);
4243
}
4344

4445
t->reset_global = i915_reset_count(&i915->gpu_error);
@@ -66,14 +67,14 @@ int igt_live_test_end(struct igt_live_test *t)
6667

6768
for_each_gt(gt, i915, i) {
6869
for_each_engine(engine, gt, id) {
69-
if (t->reset_engine[id] ==
70+
if (t->reset_engine[i][id] ==
7071
i915_reset_engine_count(&i915->gpu_error, engine))
7172
continue;
7273

7374
gt_err(gt, "%s(%s): engine '%s' was reset %d times!\n",
7475
t->func, t->name, engine->name,
7576
i915_reset_engine_count(&i915->gpu_error, engine) -
76-
t->reset_engine[id]);
77+
t->reset_engine[i][id]);
7778
return -EIO;
7879
}
7980
}

drivers/gpu/drm/i915/selftests/igt_live_test.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef IGT_LIVE_TEST_H
88
#define IGT_LIVE_TEST_H
99

10+
#include "gt/intel_gt_defines.h" /* for I915_MAX_GT */
1011
#include "gt/intel_engine.h" /* for I915_NUM_ENGINES */
1112

1213
struct drm_i915_private;
@@ -17,7 +18,7 @@ struct igt_live_test {
1718
const char *name;
1819

1920
unsigned int reset_global;
20-
unsigned int reset_engine[I915_NUM_ENGINES];
21+
unsigned int reset_engine[I915_MAX_GT][I915_NUM_ENGINES];
2122
};
2223

2324
/*

0 commit comments

Comments
 (0)