Skip to content

Commit 7f66319

Browse files
committed
accel/ivpu: Fix for missing lock around drm_gem_shmem_vmap()
drm_gem_shmem_vmap/vunmap requires dma resv lock to be held. This was missed during conversion to shmem helper. Fixes: 8d88e4c ("accel/ivpu: Use GEM shmem helper for all buffers") Signed-off-by: Jacek Lawrynowicz <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 2a20b85 commit 7f66319

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ ivpu_bo_alloc_internal(struct ivpu_device *vdev, u64 vpu_addr, u64 size, u32 fla
361361
if (ret)
362362
goto err_put;
363363

364+
dma_resv_lock(bo->base.base.resv, NULL);
364365
ret = drm_gem_shmem_vmap(&bo->base, &map);
366+
dma_resv_unlock(bo->base.base.resv);
365367
if (ret)
366368
goto err_put;
367369

@@ -376,7 +378,10 @@ void ivpu_bo_free_internal(struct ivpu_bo *bo)
376378
{
377379
struct iosys_map map = IOSYS_MAP_INIT_VADDR(bo->base.vaddr);
378380

381+
dma_resv_lock(bo->base.base.resv, NULL);
379382
drm_gem_shmem_vunmap(&bo->base, &map);
383+
dma_resv_unlock(bo->base.base.resv);
384+
380385
drm_gem_object_put(&bo->base.base);
381386
}
382387

0 commit comments

Comments
 (0)