Commit ddbb271a authored by Matthew Auld's avatar Matthew Auld Committed by Chris Wilson

drm/i915: drop the struct_mutex when wedged or trying to reset

We grab the struct_mutex in intel_crtc_page_flip, but if we are wedged
or a reset is in progress we bail early but never seem to actually
release the lock.

Fixes: 7f1847eb ("drm/i915: Simplify checking of GPU reset_counter in display pageflips")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.auld@intel.comReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: <stable@vger.kernel.org> # v4.7+
parent 70cd1476
...@@ -12206,7 +12206,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -12206,7 +12206,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error); intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error);
if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) { if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) {
ret = -EIO; ret = -EIO;
goto cleanup; goto unlock;
} }
atomic_inc(&intel_crtc->unpin_work_count); atomic_inc(&intel_crtc->unpin_work_count);
...@@ -12295,6 +12295,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, ...@@ -12295,6 +12295,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
intel_unpin_fb_obj(fb, crtc->primary->state->rotation); intel_unpin_fb_obj(fb, crtc->primary->state->rotation);
cleanup_pending: cleanup_pending:
atomic_dec(&intel_crtc->unpin_work_count); atomic_dec(&intel_crtc->unpin_work_count);
unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
cleanup: cleanup:
crtc->primary->fb = old_fb; crtc->primary->fb = old_fb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment