aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/i915/gvt/vgpu.c
diff options
context:
space:
mode:
authorHang Yuan <hang.yuan@linux.intel.com>2018-07-30 10:52:53 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2018-08-14 15:26:09 +0800
commitd6c6113bfe19af514128163a6d176437d45b7325 (patch)
tree21885e025c8aa740eaa3fdf90bb20bc80b999eb1 /drivers/gpu/drm/i915/gvt/vgpu.c
parentdrm/i915/gvt: fix cleanup sequence in intel_gvt_clean_device (diff)
downloadwireguard-linux-d6c6113bfe19af514128163a6d176437d45b7325.tar.xz
wireguard-linux-d6c6113bfe19af514128163a6d176437d45b7325.zip
drm/i915/gvt: initialize dmabuf mutex in vgpu_create
Currently, the mutex used in GVT dmabuf support is not initialized until vgpu device is opened. If one vgpu device is opened and then removed, the mutex will be used in vgpu remove operation without initialization. This patch initializes the mutex in vgpu create operation to avoid the problem. Fixes: e546e281d33d("drm/i915/gvt: Dmabuf support for GVT-g") Signed-off-by: Hang Yuan <hang.yuan@linux.intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/vgpu.c')
-rw-r--r--drivers/gpu/drm/i915/gvt/vgpu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/vgpu.c b/drivers/gpu/drm/i915/gvt/vgpu.c
index ce0d93bf67fb..a4e8e3cf74fd 100644
--- a/drivers/gpu/drm/i915/gvt/vgpu.c
+++ b/drivers/gpu/drm/i915/gvt/vgpu.c
@@ -379,6 +379,7 @@ static struct intel_vgpu *__intel_gvt_create_vgpu(struct intel_gvt *gvt,
vgpu->gvt = gvt;
vgpu->sched_ctl.weight = param->weight;
mutex_init(&vgpu->vgpu_lock);
+ mutex_init(&vgpu->dmabuf_lock);
INIT_LIST_HEAD(&vgpu->dmabuf_obj_list_head);
INIT_RADIX_TREE(&vgpu->page_track_tree, GFP_KERNEL);
idr_init(&vgpu->object_idr);