From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: Jari Tahvanainen <jari.tahvanainen@intel.com>
Subject: Re: [PATCH] drm/i915/selftests: Try to recover from a wedged GPU during reset tests
Date: Tue, 26 Sep 2017 15:48:17 +0300 [thread overview]
Message-ID: <87bmlxzkvi.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170915130929.18892-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> 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>
> ---
> drivers/gpu/drm/i915/selftests/intel_hangcheck.c | 25 +++++++++++++++++++-----
> 1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> index 02e52a146ed8..913fe752f6b4 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
> @@ -165,6 +165,7 @@ static int emit_recurse_batch(struct hang *h,
> *batch++ = lower_32_bits(vma->node.start);
> }
> *batch++ = MI_BATCH_BUFFER_END; /* not reached */
> + wmb();
>
Why not the big hammer with i915_gem_chipset_flush() here?
> flags = 0;
> if (INTEL_GEN(vm->i915) <= 5)
> @@ -621,7 +622,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;
> }
> @@ -708,10 +714,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",
> + rq->fence.seqno, hws_seqno(&h, rq));
As you pointed out the debug in here is for wrong request.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> i915_gem_request_put(rq);
> i915_gem_request_put(prev);
> +
> + i915_reset(i915, 0);
> + i915_gem_set_wedged(i915);
> +
> err = -EIO;
> goto fini;
> }
> @@ -806,7 +816,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;
> }
> @@ -843,8 +858,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),
> --
> 2.14.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-26 12:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-15 13:09 [PATCH] drm/i915/selftests: Try to recover from a wedged GPU during reset tests Chris Wilson
2017-09-15 13:29 ` Chris Wilson
2017-09-15 13:31 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-09-15 15:04 ` ✓ Fi.CI.IGT: " Patchwork
2017-09-19 14:18 ` [PATCH] " Chris Wilson
2017-09-19 14:24 ` Tahvanainen, Jari
2017-09-19 14:33 ` Chris Wilson
2017-09-25 12:01 ` Chris Wilson
2017-09-26 12:48 ` Mika Kuoppala [this message]
2017-09-26 13:03 ` Chris Wilson
2017-09-26 13:36 ` Mika Kuoppala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bmlxzkvi.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jari.tahvanainen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox