diff options
author | Matthew Auld <matthew.auld@intel.com> | 2016-11-28 05:36:48 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-11-30 05:09:26 -0500 |
commit | e411072d5740a49cdc9d0713798c30440757e451 (patch) | |
tree | 91a9f6e495af27fd4e2f9579e605d598b41aaa3f | |
parent | 2420489bcb8910188578acc0c11c75445c2e4b92 (diff) |
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: 7f1847ebf48b ("drm/i915: Simplify checking of GPU reset_counter in display pageflips")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.auld@intel.com
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: <stable@vger.kernel.org> # v4.7+
(cherry picked from commit ddbb271aea87fc6004d3c8bcdb0710e980c7ec85)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 81c11499bcf0..3cb70d73239b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -12260,7 +12260,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
12260 | intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error); | 12260 | intel_crtc->reset_count = i915_reset_count(&dev_priv->gpu_error); |
12261 | if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) { | 12261 | if (i915_reset_in_progress_or_wedged(&dev_priv->gpu_error)) { |
12262 | ret = -EIO; | 12262 | ret = -EIO; |
12263 | goto cleanup; | 12263 | goto unlock; |
12264 | } | 12264 | } |
12265 | 12265 | ||
12266 | atomic_inc(&intel_crtc->unpin_work_count); | 12266 | atomic_inc(&intel_crtc->unpin_work_count); |
@@ -12352,6 +12352,7 @@ cleanup_unpin: | |||
12352 | intel_unpin_fb_obj(fb, crtc->primary->state->rotation); | 12352 | intel_unpin_fb_obj(fb, crtc->primary->state->rotation); |
12353 | cleanup_pending: | 12353 | cleanup_pending: |
12354 | atomic_dec(&intel_crtc->unpin_work_count); | 12354 | atomic_dec(&intel_crtc->unpin_work_count); |
12355 | unlock: | ||
12355 | mutex_unlock(&dev->struct_mutex); | 12356 | mutex_unlock(&dev->struct_mutex); |
12356 | cleanup: | 12357 | cleanup: |
12357 | crtc->primary->fb = old_fb; | 12358 | crtc->primary->fb = old_fb; |