[PATCH 4.8 21/35] drm/i915: drop the struct_mutex when wedged or trying to reset

2016-12-06 Thread Greg Kroah-Hartman
4.8-stable review patch.  If anyone has any objections, please let me know.

--

From: Matthew Auld 

commit e411072d5740a49cdc9d0713798c30440757e451 upstream.

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 
Signed-off-by: Matthew Auld 
Link: 
http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.a...@intel.com
Reviewed-by: Joonas Lahtinen 
Reviewed-by: Chris Wilson 
Signed-off-by: Chris Wilson 
(cherry picked from commit ddbb271aea87fc6004d3c8bcdb0710e980c7ec85)
Signed-off-by: Jani Nikula 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/i915/intel_display.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11791,7 +11791,7 @@ static int intel_crtc_page_flip(struct d
intel_crtc->reset_counter = i915_reset_counter(_priv->gpu_error);
if (__i915_reset_in_progress_or_wedged(intel_crtc->reset_counter)) {
ret = -EIO;
-   goto cleanup;
+   goto unlock;
}
 
atomic_inc(_crtc->unpin_work_count);
@@ -11877,6 +11877,7 @@ cleanup_pending:
if (!IS_ERR_OR_NULL(request))
i915_add_request_no_flush(request);
atomic_dec(_crtc->unpin_work_count);
+unlock:
mutex_unlock(>struct_mutex);
 cleanup:
crtc->primary->fb = old_fb;




[PATCH 4.8 21/35] drm/i915: drop the struct_mutex when wedged or trying to reset

2016-12-06 Thread Greg Kroah-Hartman
4.8-stable review patch.  If anyone has any objections, please let me know.

--

From: Matthew Auld 

commit e411072d5740a49cdc9d0713798c30440757e451 upstream.

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 
Signed-off-by: Matthew Auld 
Link: 
http://patchwork.freedesktop.org/patch/msgid/20161128103648.9235-1-matthew.a...@intel.com
Reviewed-by: Joonas Lahtinen 
Reviewed-by: Chris Wilson 
Signed-off-by: Chris Wilson 
(cherry picked from commit ddbb271aea87fc6004d3c8bcdb0710e980c7ec85)
Signed-off-by: Jani Nikula 
Signed-off-by: Greg Kroah-Hartman 

---
 drivers/gpu/drm/i915/intel_display.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11791,7 +11791,7 @@ static int intel_crtc_page_flip(struct d
intel_crtc->reset_counter = i915_reset_counter(_priv->gpu_error);
if (__i915_reset_in_progress_or_wedged(intel_crtc->reset_counter)) {
ret = -EIO;
-   goto cleanup;
+   goto unlock;
}
 
atomic_inc(_crtc->unpin_work_count);
@@ -11877,6 +11877,7 @@ cleanup_pending:
if (!IS_ERR_OR_NULL(request))
i915_add_request_no_flush(request);
atomic_dec(_crtc->unpin_work_count);
+unlock:
mutex_unlock(>struct_mutex);
 cleanup:
crtc->primary->fb = old_fb;