From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/execlists: Reset ring registers on rebinding contexts
Date: Wed, 28 Mar 2018 10:58:38 +0300 [thread overview]
Message-ID: <874ll04onl.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180327210136.16750-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Tvrtko uncovered a fun issue with recovering from a wedge device. In his
> tests, he wedged the driver by injecting an unrecoverable hang whilst a
> batch was spinning. As we reset the gpu in the middle of the spinner,
> when resumed it would continue on from the next instruction in the ring
> and write it's breadcrumb. However, on wedging we updated our
> bookkeeping to indicate that the GPU had completed executing and would
> restart from after the breadcrumb; so the emission of the stale
> breadcrumb from before the reset came as a bit of a surprise.
>
Ok trying to make sense of the above and how the wedging works.
Here is my assertions.
The spinning batch was never found to be guilty of anything.
On wedge we fast forwarded all engine seqnos to be what
was last submitted.
We did hw reset.
On context image, the RING_HEAD was pointing to bb start
of spin batch (or the instruction after it)
On resubmitting the context, we saw a seqno write from pre
reset era.
So this doesn't affect only spinning batches but any busy
batch that was running while we wedged?
-Mika
> A simple fix is to when rebinding the context into the GPU, we update
> the ring register state in the context image to match our bookkeeping.
> We already have to update the RING_START and RING_TAIL, so updating
> RING_HEAD as well is trivial. This works because whenever we unbind the
> context, we keep the bookkeeping in check; and on wedging we unbind all
> contexts.
>
> Testcase: igt/gem_eio
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index ba7f7831f934..654634254b64 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -1272,6 +1272,7 @@ execlists_context_pin(struct intel_engine_cs *engine,
> ce->lrc_reg_state = vaddr + LRC_STATE_PN * PAGE_SIZE;
> ce->lrc_reg_state[CTX_RING_BUFFER_START+1] =
> i915_ggtt_offset(ce->ring->vma);
> + ce->lrc_reg_state[CTX_RING_HEAD+1] = ce->ring->head;
>
> ce->state->obj->pin_global++;
> i915_gem_context_get(ctx);
> --
> 2.16.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-03-28 7:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 21:01 [PATCH] drm/i915/execlists: Reset ring registers on rebinding contexts Chris Wilson
2018-03-27 21:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-03-27 22:10 ` ✓ Fi.CI.BAT: success " Patchwork
2018-03-28 7:07 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-03-28 19:30 ` Chris Wilson
2018-03-28 7:58 ` Mika Kuoppala [this message]
2018-03-28 8:32 ` [PATCH] " Chris Wilson
2018-03-28 10:27 ` Tvrtko Ursulin
2018-03-28 16:26 ` Tvrtko Ursulin
2018-03-28 16:36 ` Chris Wilson
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=874ll04onl.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.