RDMA/umem: Prepare to dynamic dma-buf locking specification
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Mon, 17 Oct 2022 17:22:18 +0000 (20:22 +0300)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Mon, 17 Oct 2022 22:21:45 +0000 (01:21 +0300)
Prepare InfiniBand drivers to the common dynamic dma-buf locking
convention by starting to use the unlocked versions of dma-buf API
functions.

Acked-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221017172229.42269-11-dmitry.osipenko@collabora.com
drivers/infiniband/core/umem_dmabuf.c

index 04c04e6..43b26bc 100644 (file)
@@ -26,7 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
        if (umem_dmabuf->sgt)
                goto wait_fence;
 
-       sgt = dma_buf_map_attachment(umem_dmabuf->attach, DMA_BIDIRECTIONAL);
+       sgt = dma_buf_map_attachment_unlocked(umem_dmabuf->attach,
+                                             DMA_BIDIRECTIONAL);
        if (IS_ERR(sgt))
                return PTR_ERR(sgt);
 
@@ -102,8 +103,8 @@ void ib_umem_dmabuf_unmap_pages(struct ib_umem_dmabuf *umem_dmabuf)
                umem_dmabuf->last_sg_trim = 0;
        }
 
-       dma_buf_unmap_attachment(umem_dmabuf->attach, umem_dmabuf->sgt,
-                                DMA_BIDIRECTIONAL);
+       dma_buf_unmap_attachment_unlocked(umem_dmabuf->attach, umem_dmabuf->sgt,
+                                         DMA_BIDIRECTIONAL);
 
        umem_dmabuf->sgt = NULL;
 }