diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-30 05:29:51 -0500 |
---|---|---|
committer | Joonas Lahtinen <joonas.lahtinen@linux.intel.com> | 2017-12-05 09:56:28 -0500 |
commit | dda4b8f73231e70df32f3a218b7ceb6704ec860c (patch) | |
tree | 87c7c05da3750e227c9859ef6558a90e92c73131 | |
parent | ae64f9bd1d3621b5e60d7363bc20afb46aede215 (diff) |
drm/i915: Skip switch-to-kernel-context on suspend when wedged
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")
Testcase: igt/gem_eio/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>
Link: https://patchwork.freedesktop.org/patch/msgid/20171130102951.14965-1-chris@chris-wilson.co.uk
(cherry picked from commit ecf73eb2d27d43b2153bb80671768a06d35521f1)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3a140eedfc83..46bdea2de268 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -4712,17 +4712,19 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv) | |||
4712 | * state. Fortunately, the kernel_context is disposable and we do | 4712 | * state. Fortunately, the kernel_context is disposable and we do |
4713 | * not rely on its state. | 4713 | * not rely on its state. |
4714 | */ | 4714 | */ |
4715 | ret = i915_gem_switch_to_kernel_context(dev_priv); | 4715 | if (!i915_terminally_wedged(&dev_priv->gpu_error)) { |
4716 | if (ret) | 4716 | ret = i915_gem_switch_to_kernel_context(dev_priv); |
4717 | goto err_unlock; | 4717 | if (ret) |
4718 | goto err_unlock; | ||
4718 | 4719 | ||
4719 | ret = i915_gem_wait_for_idle(dev_priv, | 4720 | ret = i915_gem_wait_for_idle(dev_priv, |
4720 | I915_WAIT_INTERRUPTIBLE | | 4721 | I915_WAIT_INTERRUPTIBLE | |
4721 | I915_WAIT_LOCKED); | 4722 | I915_WAIT_LOCKED); |
4722 | if (ret && ret != -EIO) | 4723 | if (ret && ret != -EIO) |
4723 | goto err_unlock; | 4724 | goto err_unlock; |
4724 | 4725 | ||
4725 | assert_kernel_context_is_current(dev_priv); | 4726 | assert_kernel_context_is_current(dev_priv); |
4727 | } | ||
4726 | i915_gem_contexts_lost(dev_priv); | 4728 | i915_gem_contexts_lost(dev_priv); |
4727 | mutex_unlock(&dev->struct_mutex); | 4729 | mutex_unlock(&dev->struct_mutex); |
4728 | 4730 | ||