Skip to content

Commit

Permalink
drm/i915/selftests: Disable heartbeat around hang tests
Browse files Browse the repository at this point in the history
If the heartbeat fires in the middle of the preempt-hang test, it
consumes our forced hang disrupting the test.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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/20200131130319.2998318-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jan 31, 2020
1 parent bd46aa2 commit b0e02a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/gpu/drm/i915/gt/selftest_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2465,15 +2465,19 @@ static int live_preempt_hang(void *arg)
I915_USER_PRIORITY(I915_CONTEXT_MIN_USER_PRIORITY);

for_each_engine(engine, gt, id) {
unsigned long heartbeat;
struct i915_request *rq;

if (!intel_engine_has_preemption(engine))
continue;

engine_heartbeat_disable(engine, &heartbeat);

rq = spinner_create_request(&spin_lo, ctx_lo, engine,
MI_ARB_CHECK);
if (IS_ERR(rq)) {
err = PTR_ERR(rq);
engine_heartbeat_enable(engine, heartbeat);
goto err_ctx_lo;
}

Expand All @@ -2483,13 +2487,15 @@ static int live_preempt_hang(void *arg)
GEM_TRACE_DUMP();
intel_gt_set_wedged(gt);
err = -EIO;
engine_heartbeat_enable(engine, heartbeat);
goto err_ctx_lo;
}

rq = spinner_create_request(&spin_hi, ctx_hi, engine,
MI_ARB_CHECK);
if (IS_ERR(rq)) {
igt_spinner_end(&spin_lo);
engine_heartbeat_enable(engine, heartbeat);
err = PTR_ERR(rq);
goto err_ctx_lo;
}
Expand All @@ -2504,6 +2510,7 @@ static int live_preempt_hang(void *arg)
pr_err("Preemption did not occur within timeout!");
GEM_TRACE_DUMP();
intel_gt_set_wedged(gt);
engine_heartbeat_enable(engine, heartbeat);
err = -EIO;
goto err_ctx_lo;
}
Expand All @@ -2518,12 +2525,15 @@ static int live_preempt_hang(void *arg)
GEM_TRACE("hi spinner failed to start\n");
GEM_TRACE_DUMP();
intel_gt_set_wedged(gt);
engine_heartbeat_enable(engine, heartbeat);
err = -EIO;
goto err_ctx_lo;
}

igt_spinner_end(&spin_hi);
igt_spinner_end(&spin_lo);
engine_heartbeat_enable(engine, heartbeat);

if (igt_flush_test(gt->i915)) {
err = -EIO;
goto err_ctx_lo;
Expand Down

0 comments on commit b0e02a7

Please sign in to comment.