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: Skip switch-to-kernel-context on suspend when wedged
Date: Fri, 01 Dec 2017 11:16:10 +0200 [thread overview]
Message-ID: <87374ust9h.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20171130102951.14965-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> If the HW is already wedged, attempting to submit a request will
> generate an -EIO. If we tried this during suspend, we would abort
> whereas all we want to do is to go sleep and throw away the corrupt
> state.
>
> Fixes: 5ab57c702069 ("drm/i915: Flush logical context image out to memory upon suspend")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 354b0546a191..e083f242b8dc 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4774,17 +4774,19 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)
> * state. Fortunately, the kernel_context is disposable and we do
> * not rely on its state.
> */
> - ret = i915_gem_switch_to_kernel_context(dev_priv);
> - if (ret)
> - goto err_unlock;
> + if (!i915_terminally_wedged(&dev_priv->gpu_error)) {
> + ret = i915_gem_switch_to_kernel_context(dev_priv);
> + if (ret)
> + goto err_unlock;
>
> - ret = i915_gem_wait_for_idle(dev_priv,
> - I915_WAIT_INTERRUPTIBLE |
> - I915_WAIT_LOCKED);
> - if (ret && ret != -EIO)
> - goto err_unlock;
> + ret = i915_gem_wait_for_idle(dev_priv,
> + I915_WAIT_INTERRUPTIBLE |
> + I915_WAIT_LOCKED);
> + if (ret && ret != -EIO)
> + goto err_unlock;
>
> - assert_kernel_context_is_current(dev_priv);
> + assert_kernel_context_is_current(dev_priv);
> + }
> i915_gem_contexts_lost(dev_priv);
> mutex_unlock(&dev->struct_mutex);
>
> --
> 2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-12-01 9:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 19:53 [PATCH] drm/i915: Skip switch-to-kernel-context on suspend when wedged Chris Wilson
2017-11-29 21:20 ` Chris Wilson
2017-11-30 9:08 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-11-30 10:27 ` ✓ Fi.CI.BAT: success " Patchwork
2017-11-30 10:29 ` [PATCH] " Chris Wilson
2017-11-30 10:29 ` Chris Wilson
2017-12-01 9:16 ` Mika Kuoppala [this message]
2017-12-01 9:27 ` Chris Wilson
2017-11-30 13:29 ` ✗ Fi.CI.IGT: failure for " Patchwork
2017-11-30 16:54 ` ✗ Fi.CI.BAT: failure for drm/i915: Skip switch-to-kernel-context on suspend when wedged (rev2) Patchwork
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=87374ust9h.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.