Skip to content
Commit b1c15835 authored by Wei Hu\(Xavier\)'s avatar Wei Hu\(Xavier\) Committed by Jason Gunthorpe
Browse files

RDMA/hns: Get rid of virt_to_page and vmap calls after dma_alloc_coherent

In general dma_alloc_coherent() returns a CPU virtual address and
a DMA address, and we have no guarantee that the virtual address
is either in the linear map or vmalloc. It could be in  some other special
place. We have no guarantee that the underlying memory even has
an associated struct page at all.

In current code, there are incorrect usage as below:
dma_alloc_coherent + virt_to_page + vmap. There will probably
introduce coherency problem. This patch fixes it to get rid of
virt_to_page and vmap calls at Leon's suggestion. The related
link: https://lkml.org/lkml/2017/11/7/34

Fixes: 9a443537

("IB/hns: Add driver files for hns RoCE driver")
Signed-off-by: default avatarWei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: default avatarShaobo Xu <xushaobo2@huawei.com>
Signed-off-by: default avatarLijun Ou <oulijun@huawei.com>
Signed-off-by: default avatarYixian Liu <liuyixian@huawei.com>
Signed-off-by: default avatarXiping Zhang (Francis) <zhangxiping3@huawei.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent db270c41
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment