aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-10-15 10:37:25 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2017-10-16 15:44:19 -0400
commit6f74b36b92cf9ee6450258fa341cff7c455a138f (patch)
tree314fccd140e91189a723b133a11ddafc6fc537fc
parentcc731f5a3b1f592d8aef04c9de720c6bc09b209a (diff)
drm/i915: Skip HW reinitialisation on resume if still wedged
If we fail to recover the HW state upon resume (i.e. our attempt to clear the wedged bit and reset during i915_gem_sanitize() fails), then skip the HW restart inside i915_gem_init_hw(). We will ultimately do the HW restart when successfully unwedging and resetting the HW later, but attempting to restore a wedged device upon resume is risky as the HW is in an unknown state. v2: Suppress the error message when detecting the already wedged HW. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103240 Testcase: igt/gem_eio/in-flight-suspend Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171015143725.27764-1-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1304152bd28b..ee2a30422020 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4867,6 +4867,10 @@ int i915_gem_init_hw(struct drm_i915_private *dev_priv)
4867 init_unused_rings(dev_priv); 4867 init_unused_rings(dev_priv);
4868 4868
4869 BUG_ON(!dev_priv->kernel_context); 4869 BUG_ON(!dev_priv->kernel_context);
4870 if (i915_terminally_wedged(&dev_priv->gpu_error)) {
4871 ret = -EIO;
4872 goto out;
4873 }
4870 4874
4871 ret = i915_ppgtt_init_hw(dev_priv); 4875 ret = i915_ppgtt_init_hw(dev_priv);
4872 if (ret) { 4876 if (ret) {
@@ -4965,8 +4969,10 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
4965 * wedged. But we only want to do this where the GPU is angry, 4969 * wedged. But we only want to do this where the GPU is angry,
4966 * for all other failure, such as an allocation failure, bail. 4970 * for all other failure, such as an allocation failure, bail.
4967 */ 4971 */
4968 DRM_ERROR("Failed to initialize GPU, declaring it wedged\n"); 4972 if (!i915_terminally_wedged(&dev_priv->gpu_error)) {
4969 i915_gem_set_wedged(dev_priv); 4973 DRM_ERROR("Failed to initialize GPU, declaring it wedged\n");
4974 i915_gem_set_wedged(dev_priv);
4975 }
4970 ret = 0; 4976 ret = 0;
4971 } 4977 }
4972 4978