From: Damien Lespiau <damien.lespiau@intel.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/i915: clear up wedged transitions
Date: Wed, 5 Dec 2012 14:54:32 +0000 [thread overview]
Message-ID: <CAPX-8+-KLQO=FF5SuwKiapx4ewCL2bs_Y_-7dE9oMgQTfDX5fw@mail.gmail.com> (raw)
In-Reply-To: <1352996243-15590-1-git-send-email-daniel.vetter@ffwll.ch>
On Thu, Nov 15, 2012 at 4:17 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> We have two important transitions of the wedged state in the current
> code:
>
> - 0 -> 1: This means a hang has been detected, and signals to everyone
> that they please get of any locks, so that the reset work item can
> do its job.
>
> - 1 -> 0: The reset handler has completed.
>
> Now the last transition mixes up two states: "Reset completed and
> successful" and "Reset failed". To distinguish these two we do some
> tricks with the reset completion, but I simply could not convince
> myself that this doesn't race under odd circumstances.
>
> Hence split this up, and add a new terminal state indicating that the
> hw is gone for good.
>
> Also add explicit #defines for both states, update comments.
>
> v2: Split out the reset handling bugfix for the throttle ioctl.
>
> v3: s/tmp/wedged/ sugested by Chris Wilson. Also fixup up a rebase
> error which prevented this patch from actually compiling.
>
> v4: To unify the wedged state with the reset counter, keep the
> reset-in-progress state just as a flag. The terminally-wedged state is
> now denoted with a big number.
>
> v5: Add a comment to the reset_counter special values explaining that
> WEDGED & RESET_IN_PROGRESS needs to be true for the code to be
> correct.
>
> v6: Fixup logic errors introduced with the wedged+reset_counter
> unification. Since WEDGED implies reset-in-progress (in a way we're
> terminally stuck in the dead-but-reset-not-completed state), we need
> ensure that we check for this everywhere. The specific bug was in
> wait_for_error, which would simply have timed out.
>
> v7: Extract an inline i915_reset_in_progress helper to make the code
> more readable. Also annote the reset-in-progress case with an
> unlikely, to help the compiler optimize the fastpath. Do the same for
> the terminally wedged case with i915_terminally_wedged.
>
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Right, so the usage of a wait queue makes the code quite a bit more
understandable I had to scratch my head for quite a bit with the
x->done poking.
I think I'd have love to see the "completion -> wait_queue + 2 reset
states" and the "gpu_error.wedge -> gpu_error.reset_counter"
transitions as two different patches (well, I did because of the 2
versions sent, so all is good)
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
--
Damien
next prev parent reply other threads:[~2012-12-05 14:54 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 16:14 [PATCH 0/6] robustify reset transitions Daniel Vetter
2012-11-14 16:14 ` [PATCH 1/6] drm/i915: move dev_priv->mm out of line Daniel Vetter
2012-12-04 16:31 ` Damien Lespiau
2012-11-14 16:14 ` [PATCH 2/6] drm/i915: extract hangcheck/reset/error_state state into substruct Daniel Vetter
2012-12-04 17:20 ` Damien Lespiau
2012-11-14 16:14 ` [PATCH 3/6] drm/i915: move wedged to the other gpu error handling stuff Daniel Vetter
2012-12-04 17:24 ` Damien Lespiau
2012-11-14 16:14 ` [PATCH 4/6] drm/i915: fix reset handling in the throttle ioctl Daniel Vetter
2012-12-05 14:08 ` Damien Lespiau
2012-11-14 16:14 ` [PATCH 5/6] drm/i915: clear up wedged transitions Daniel Vetter
2012-11-14 16:14 ` [PATCH 6/6] drm/i915: create a race-free reset detection Daniel Vetter
2012-11-15 16:17 ` [PATCH 1/2] drm/i915: clear up wedged transitions Daniel Vetter
2012-11-15 16:17 ` [PATCH 2/2] drm/i915: create a race-free reset detection Daniel Vetter
2012-12-05 16:35 ` Damien Lespiau
2012-12-06 8:01 ` [PATCH] " Daniel Vetter
2012-12-06 15:23 ` [PATCH] drm/i915: clarify concurrent hang detect/gpu reset consistency Daniel Vetter
2013-01-18 20:48 ` [PATCH 2/2] drm/i915: create a race-free reset detection Daniel Vetter
2013-01-21 12:06 ` Damien Lespiau
2013-01-21 19:15 ` Daniel Vetter
2012-12-05 14:54 ` Damien Lespiau [this message]
2012-12-05 16:38 ` [PATCH 1/2] drm/i915: clear up wedged transitions Damien Lespiau
2012-12-05 17:14 ` Daniel Vetter
2014-09-03 20:26 ` Chris Wilson
2014-09-04 6:03 ` Daniel Vetter
2014-09-04 6:11 ` 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='CAPX-8+-KLQO=FF5SuwKiapx4ewCL2bs_Y_-7dE9oMgQTfDX5fw@mail.gmail.com' \
--to=damien.lespiau@intel.com \
--cc=daniel.vetter@ffwll.ch \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).