]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDMA/cxgb4: use dma_mmap_coherent() for mapping non-contiguous memory
authorAnumula Murali Mohan Reddy <anumula@chelsio.com>
Tue, 16 Jul 2024 14:25:32 +0000 (19:55 +0530)
committerLeon Romanovsky <leon@kernel.org>
Mon, 29 Jul 2024 08:41:16 +0000 (11:41 +0300)
commit75ab1533d79b046152d424ffe947f79f9d15682c
tree7722822a6bc89af6bd6cc2c4ce3bc7416388eb78
parent8400291e289ee6b2bf9779ff1c83a291501f017b
RDMA/cxgb4: use dma_mmap_coherent() for mapping non-contiguous memory

dma_alloc_coherent() allocates contiguous memory irrespective of
iommu mode, but after commit f5ff79fddf0e ("dma-mapping: remove CONFIG_DMA_REMAP")
if iommu is enabled in translate mode, dma_alloc_coherent() may
allocate non-contiguous memory. Attempt to map this memory results in panic.
This patch fixes the issue by using dma_mmap_coherent() to map each page
to user space.

Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Link: https://lore.kernel.org/r/20240716142532.97423-1-anumula@chelsio.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/cxgb4/cq.c
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
drivers/infiniband/hw/cxgb4/provider.c
drivers/infiniband/hw/cxgb4/qp.c