Skip to content

Commit 94ed475

Browse files
committed
drm/i915/selftests: Make the hanging request non-preemptible
In some of our hangtests, we try to reset an active engine while it is spinning inside the recursive spinner. However, we also try to flood the engine with requests that preempt the hang, and so should disable the preemption to be sure that we reset the right request. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200607222108.14401-2-chris@chris-wilson.co.uk
1 parent 8733a06 commit 94ed475

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

drivers/gpu/drm/i915/gt/selftest_hangcheck.c

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)
203203
*batch++ = lower_32_bits(hws_address(hws, rq));
204204
*batch++ = upper_32_bits(hws_address(hws, rq));
205205
*batch++ = rq->fence.seqno;
206-
*batch++ = MI_ARB_CHECK;
206+
*batch++ = MI_NOOP;
207207

208208
memset(batch, 0, 1024);
209209
batch += 1024 / sizeof(*batch);
210210

211-
*batch++ = MI_ARB_CHECK;
211+
*batch++ = MI_NOOP;
212212
*batch++ = MI_BATCH_BUFFER_START | 1 << 8 | 1;
213213
*batch++ = lower_32_bits(vma->node.start);
214214
*batch++ = upper_32_bits(vma->node.start);
@@ -217,37 +217,37 @@ hang_create_request(struct hang *h, struct intel_engine_cs *engine)
217217
*batch++ = 0;
218218
*batch++ = lower_32_bits(hws_address(hws, rq));
219219
*batch++ = rq->fence.seqno;
220-
*batch++ = MI_ARB_CHECK;
220+
*batch++ = MI_NOOP;
221221

222222
memset(batch, 0, 1024);
223223
batch += 1024 / sizeof(*batch);
224224

225-
*batch++ = MI_ARB_CHECK;
225+
*batch++ = MI_NOOP;
226226
*batch++ = MI_BATCH_BUFFER_START | 1 << 8;
227227
*batch++ = lower_32_bits(vma->node.start);
228228
} else if (INTEL_GEN(gt->i915) >= 4) {
229229
*batch++ = MI_STORE_DWORD_IMM_GEN4 | MI_USE_GGTT;
230230
*batch++ = 0;
231231
*batch++ = lower_32_bits(hws_address(hws, rq));
232232
*batch++ = rq->fence.seqno;
233-
*batch++ = MI_ARB_CHECK;
233+
*batch++ = MI_NOOP;
234234

235235
memset(batch, 0, 1024);
236236
batch += 1024 / sizeof(*batch);
237237

238-
*batch++ = MI_ARB_CHECK;
238+
*batch++ = MI_NOOP;
239239
*batch++ = MI_BATCH_BUFFER_START | 2 << 6;
240240
*batch++ = lower_32_bits(vma->node.start);
241241
} else {
242242
*batch++ = MI_STORE_DWORD_IMM | MI_MEM_VIRTUAL;
243243
*batch++ = lower_32_bits(hws_address(hws, rq));
244244
*batch++ = rq->fence.seqno;
245-
*batch++ = MI_ARB_CHECK;
245+
*batch++ = MI_NOOP;
246246

247247
memset(batch, 0, 1024);
248248
batch += 1024 / sizeof(*batch);
249249

250-
*batch++ = MI_ARB_CHECK;
250+
*batch++ = MI_NOOP;
251251
*batch++ = MI_BATCH_BUFFER_START | 2 << 6;
252252
*batch++ = lower_32_bits(vma->node.start);
253253
}
@@ -866,13 +866,29 @@ static int __igt_reset_engines(struct intel_gt *gt,
866866
count++;
867867

868868
if (rq) {
869+
if (rq->fence.error != -EIO) {
870+
pr_err("i915_reset_engine(%s:%s):"
871+
" failed to reset request %llx:%lld\n",
872+
engine->name, test_name,
873+
rq->fence.context,
874+
rq->fence.seqno);
875+
i915_request_put(rq);
876+
877+
GEM_TRACE_DUMP();
878+
intel_gt_set_wedged(gt);
879+
err = -EIO;
880+
break;
881+
}
882+
869883
if (i915_request_wait(rq, 0, HZ / 5) < 0) {
870884
struct drm_printer p =
871885
drm_info_printer(gt->i915->drm.dev);
872886

873887
pr_err("i915_reset_engine(%s:%s):"
874-
" failed to complete request after reset\n",
875-
engine->name, test_name);
888+
" failed to complete request %llx:%lld after reset\n",
889+
engine->name, test_name,
890+
rq->fence.context,
891+
rq->fence.seqno);
876892
intel_engine_dump(engine, &p,
877893
"%s\n", engine->name);
878894
i915_request_put(rq);

0 commit comments

Comments
 (0)