Skip to content

Commit

Permalink
drm/i915/selftests: Try to recover from a wedged GPU during reset tests
Browse files Browse the repository at this point in the history
If we see the seqno stop progressing, we abandon the test for fear that
the GPU died following the reset. However, during test teardown we still
wait for the GPU to idle before continuing, but we have already
confirmed that the GPU is dead. Furthermore, since we are inside a reset
test, we have disabled the hangchecker, and so there is no safety net and
we wait indefinitely. Detect the stuck GPU and declare it wedged as a
state of emergency so we can escape.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jari Tahvanainen <jari.tahvanainen@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170915130929.18892-1-chris@chris-wilson.co.uk
Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
  • Loading branch information
Chris Wilson committed Sep 26, 2017
1 parent 9a2cbf2 commit 87dc03a
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions drivers/gpu/drm/i915/selftests/intel_hangcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,12 @@ static int igt_wait_reset(void *arg)
__i915_add_request(rq, true);

if (!wait_for_hang(&h, rq)) {
pr_err("Failed to start request %x\n", rq->fence.seqno);
pr_err("Failed to start request %x, at %x\n",
rq->fence.seqno, hws_seqno(&h, rq));

i915_reset(i915, 0);
i915_gem_set_wedged(i915);

err = -EIO;
goto out_rq;
}
Expand Down Expand Up @@ -708,10 +713,14 @@ static int igt_reset_queue(void *arg)
__i915_add_request(rq, true);

if (!wait_for_hang(&h, prev)) {
pr_err("Failed to start request %x\n",
prev->fence.seqno);
pr_err("Failed to start request %x, at %x\n",
prev->fence.seqno, hws_seqno(&h, prev));
i915_gem_request_put(rq);
i915_gem_request_put(prev);

i915_reset(i915, 0);
i915_gem_set_wedged(i915);

err = -EIO;
goto fini;
}
Expand Down Expand Up @@ -806,7 +815,12 @@ static int igt_handle_error(void *arg)
__i915_add_request(rq, true);

if (!wait_for_hang(&h, rq)) {
pr_err("Failed to start request %x\n", rq->fence.seqno);
pr_err("Failed to start request %x, at %x\n",
rq->fence.seqno, hws_seqno(&h, rq));

i915_reset(i915, 0);
i915_gem_set_wedged(i915);

err = -EIO;
goto err_request;
}
Expand Down Expand Up @@ -843,8 +857,8 @@ static int igt_handle_error(void *arg)
int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
{
static const struct i915_subtest tests[] = {
SUBTEST(igt_global_reset), /* attempt to recover GPU first */
SUBTEST(igt_hang_sanitycheck),
SUBTEST(igt_global_reset),
SUBTEST(igt_reset_engine),
SUBTEST(igt_reset_active_engines),
SUBTEST(igt_wait_reset),
Expand Down

0 comments on commit 87dc03a

Please sign in to comment.