Skip to content

Commit c956940

Browse files
maorgottliebjgunthorpe
authored andcommitted
RDMA/umem: Use dma-buf locked API to solve deadlock
The cited commit moves umem to call the unlocked versions of dmabuf unmap/map attachment, but the lock is held while calling to these functions, hence move back to the locked versions of these APIs. Fixes: 21c9c5c ("RDMA/umem: Prepare to dynamic dma-buf locking specification") Link: https://lore.kernel.org/r/311c2cb791f8af75486df446819071357353db1b.1675088709.git.leon@kernel.org Signed-off-by: Maor Gottlieb <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Dmitry Osipenko <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent b7e08a5 commit c956940

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/infiniband/core/umem_dmabuf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
2626
if (umem_dmabuf->sgt)
2727
goto wait_fence;
2828

29-
sgt = dma_buf_map_attachment_unlocked(umem_dmabuf->attach,
30-
DMA_BIDIRECTIONAL);
29+
sgt = dma_buf_map_attachment(umem_dmabuf->attach,
30+
DMA_BIDIRECTIONAL);
3131
if (IS_ERR(sgt))
3232
return PTR_ERR(sgt);
3333

@@ -103,8 +103,8 @@ void ib_umem_dmabuf_unmap_pages(struct ib_umem_dmabuf *umem_dmabuf)
103103
umem_dmabuf->last_sg_trim = 0;
104104
}
105105

106-
dma_buf_unmap_attachment_unlocked(umem_dmabuf->attach, umem_dmabuf->sgt,
107-
DMA_BIDIRECTIONAL);
106+
dma_buf_unmap_attachment(umem_dmabuf->attach, umem_dmabuf->sgt,
107+
DMA_BIDIRECTIONAL);
108108

109109
umem_dmabuf->sgt = NULL;
110110
}

0 commit comments

Comments
 (0)