diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-30 05:29:51 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-30 06:54:01 -0500 |
commit | ecf73eb2d27d43b2153bb80671768a06d35521f1 (patch) | |
tree | 3bfbcd9e2260aafeb49861917d1fb05c9503feb2 | |
parent | 7436830c8d1a3aab61d131d5e0494e2dbb9e55bd (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
-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 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) | |||
4774 | * state. Fortunately, the kernel_context is disposable and we do | 4774 | * state. Fortunately, the kernel_context is disposable and we do |
4775 | * not rely on its state. | 4775 | * not rely on its state. |
4776 | */ | 4776 | */ |
4777 | ret = i915_gem_switch_to_kernel_context(dev_priv); | 4777 | if (!i915_terminally_wedged(&dev_priv->gpu_error)) { |
4778 | if (ret) | 4778 | ret = i915_gem_switch_to_kernel_context(dev_priv); |
4779 | goto err_unlock; | 4779 | if (ret) |
4780 | goto err_unlock; | ||
4780 | 4781 | ||
4781 | ret = i915_gem_wait_for_idle(dev_priv, | 4782 | ret = i915_gem_wait_for_idle(dev_priv, |
4782 | I915_WAIT_INTERRUPTIBLE | | 4783 | I915_WAIT_INTERRUPTIBLE | |
4783 | I915_WAIT_LOCKED); | 4784 | I915_WAIT_LOCKED); |
4784 | if (ret && ret != -EIO) | 4785 | if (ret && ret != -EIO) |
4785 | goto err_unlock; | 4786 | goto err_unlock; |
4786 | 4787 | ||
4787 | assert_kernel_context_is_current(dev_priv); | 4788 | assert_kernel_context_is_current(dev_priv); |
4789 | } | ||
4788 | i915_gem_contexts_lost(dev_priv); | 4790 | i915_gem_contexts_lost(dev_priv); |
4789 | mutex_unlock(&dev->struct_mutex); | 4791 | mutex_unlock(&dev->struct_mutex); |
4790 | 4792 | ||