Skip to content

Commit d20a8f4

Browse files
sgruszkajlawryno
authored andcommitted
accel/ivpu: Fix old dma_buf api usage
Update according to new dma-buf locking scheme. Remove redundant WARN_ON()'s, dma_buf functions internally have the same warnings already. Fixes: 647371a ("accel/ivpu: Add GEM buffer object management") Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit ec6ec9c) Signed-off-by: Jacek Lawrynowicz <[email protected]>
1 parent 62079b6 commit d20a8f4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/accel/ivpu/ivpu_gem.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
4242
struct ivpu_device *vdev = ivpu_bo_to_vdev(bo);
4343
struct sg_table *sgt;
4444

45-
WARN_ON(!bo->base.import_attach);
46-
47-
sgt = dma_buf_map_attachment(bo->base.import_attach, DMA_BIDIRECTIONAL);
45+
sgt = dma_buf_map_attachment_unlocked(bo->base.import_attach, DMA_BIDIRECTIONAL);
4846
if (IS_ERR(sgt)) {
4947
ivpu_err(vdev, "Failed to map attachment: %ld\n", PTR_ERR(sgt));
5048
return PTR_ERR(sgt);
@@ -56,9 +54,7 @@ static int prime_map_pages_locked(struct ivpu_bo *bo)
5654

5755
static void prime_unmap_pages_locked(struct ivpu_bo *bo)
5856
{
59-
WARN_ON(!bo->base.import_attach);
60-
61-
dma_buf_unmap_attachment(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
57+
dma_buf_unmap_attachment_unlocked(bo->base.import_attach, bo->sgt, DMA_BIDIRECTIONAL);
6258
bo->sgt = NULL;
6359
}
6460

0 commit comments

Comments
 (0)