drm/vmwgfx: Fix an overlay lockdep error

Fix a circular locking dependency between
struct vmw_overlay::mutex and
struct vmw_private::reservation_sem

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Thomas Hellstrom 2015-06-25 12:00:39 -07:00
parent 3eab3d9eef
commit ee511a835a
1 changed files with 6 additions and 6 deletions

View File

@ -900,20 +900,21 @@ int vmw_stream_claim_ioctl(struct drm_device *dev, void *data,
ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv), ret = ttm_mem_global_alloc(vmw_mem_glob(dev_priv),
vmw_user_stream_size, vmw_user_stream_size,
false, true); false, true);
ttm_read_unlock(&dev_priv->reservation_sem);
if (unlikely(ret != 0)) { if (unlikely(ret != 0)) {
if (ret != -ERESTARTSYS) if (ret != -ERESTARTSYS)
DRM_ERROR("Out of graphics memory for stream" DRM_ERROR("Out of graphics memory for stream"
" creation.\n"); " creation.\n");
goto out_unlock;
}
goto out_ret;
}
stream = kmalloc(sizeof(*stream), GFP_KERNEL); stream = kmalloc(sizeof(*stream), GFP_KERNEL);
if (unlikely(stream == NULL)) { if (unlikely(stream == NULL)) {
ttm_mem_global_free(vmw_mem_glob(dev_priv), ttm_mem_global_free(vmw_mem_glob(dev_priv),
vmw_user_stream_size); vmw_user_stream_size);
ret = -ENOMEM; ret = -ENOMEM;
goto out_unlock; goto out_ret;
} }
res = &stream->stream.res; res = &stream->stream.res;
@ -926,7 +927,7 @@ int vmw_stream_claim_ioctl(struct drm_device *dev, void *data,
ret = vmw_stream_init(dev_priv, &stream->stream, vmw_user_stream_free); ret = vmw_stream_init(dev_priv, &stream->stream, vmw_user_stream_free);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
goto out_unlock; goto out_ret;
tmp = vmw_resource_reference(res); tmp = vmw_resource_reference(res);
ret = ttm_base_object_init(tfile, &stream->base, false, VMW_RES_STREAM, ret = ttm_base_object_init(tfile, &stream->base, false, VMW_RES_STREAM,
@ -940,8 +941,7 @@ int vmw_stream_claim_ioctl(struct drm_device *dev, void *data,
arg->stream_id = res->id; arg->stream_id = res->id;
out_err: out_err:
vmw_resource_unreference(&res); vmw_resource_unreference(&res);
out_unlock: out_ret:
ttm_read_unlock(&dev_priv->reservation_sem);
return ret; return ret;
} }