From: Thomas Hellstrom Date: Mon, 31 Mar 2014 08:20:30 +0000 (+0200) Subject: drm/vmwgfx: Fix query buffer locking order violation X-Git-Tag: v3.14.5~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=900bbb9d90c65a8fa4efa9dca20f5c780e698bae;p=thirdparty%2Fkernel%2Fstable.git drm/vmwgfx: Fix query buffer locking order violation commit c8e5e010ef12df6707a1d711a5279a22f67a355e upstream. The query buffers were reserved while holding the binding mutex, which caused a circular locking dependency. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c index 1e80152674b50..4fbcfdb02360e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_context.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_context.c @@ -117,10 +117,10 @@ static void vmw_hw_context_destroy(struct vmw_resource *res) (void) vmw_context_binding_state_kill (&container_of(res, struct vmw_user_context, res)->cbs); (void) vmw_gb_context_destroy(res); + mutex_unlock(&dev_priv->binding_mutex); if (dev_priv->pinned_bo != NULL && !dev_priv->query_cid_valid) __vmw_execbuf_release_pinned_bo(dev_priv, NULL); - mutex_unlock(&dev_priv->binding_mutex); mutex_unlock(&dev_priv->cmdbuf_mutex); return; }