drm/i915: Clear wedged status upon resume
authorChris Wilson <[email protected]>
Sat, 26 Aug 2017 11:09:34 +0000 (12:09 +0100)
committerChris Wilson <[email protected]>
Tue, 29 Aug 2017 15:56:38 +0000 (16:56 +0100)
When we wake up from suspend, the device has been powered down and
should come back afresh. We should be able to safely remove the wedged
status from the previous session and start afresh.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
drivers/gpu/drm/i915/i915_gem.c

index a1ba989f8da5956304190cf73b04a8ff59c2adda..b99a668f39a7e2b07ad8bcc9c4cf6a888c663abd 100644 (file)
@@ -4523,6 +4523,12 @@ static void assert_kernel_context_is_current(struct drm_i915_private *dev_priv)
 
 void i915_gem_sanitize(struct drm_i915_private *i915)
 {
+       if (i915_terminally_wedged(&i915->gpu_error)) {
+               mutex_lock(&i915->drm.struct_mutex);
+               i915_gem_unset_wedged(i915);
+               mutex_unlock(&i915->drm.struct_mutex);
+       }
+
        /*
         * If we inherit context state from the BIOS or earlier occupants
         * of the GPU, the GPU may be in an inconsistent state when we