-
由 Wei Hu\(Xavier\) 提交于
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: NWei Hu (Xavier) <xavier.huwei@huawei.com> Signed-off-by: NShaobo Xu <xushaobo2@huawei.com> Signed-off-by: NLijun Ou <oulijun@huawei.com> Signed-off-by: NYixian Liu <liuyixian@huawei.com> Signed-off-by: NXiping Zhang (Francis) <zhangxiping3@huawei.com> Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
b1c15835