RDMA/hns: Modify the mapping attribute of doorbell to device
authorYixing Liu <liuyixing1@huawei.com>
Mon, 6 Dec 2021 13:36:52 +0000 (21:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 11:02:53 +0000 (12:02 +0100)
commit 39d5534b1302189c809e90641ffae8cbdc42a8fc upstream.

It is more general for ARM device drivers to use the device attribute to
map PCI BAR spaces.

Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver")
Link: https://lore.kernel.org/r/20211206133652.27476-1-liangwenpeng@huawei.com
Signed-off-by: Yixing Liu <liuyixing1@huawei.com>
Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/hns/hns_roce_main.c

index 8233bec053ee3c26055868a25b09315278a6413b..a906c6078b722ac3725363b799fe5a69c530f6fb 100644 (file)
@@ -442,7 +442,7 @@ static int hns_roce_mmap(struct ib_ucontext *uctx, struct vm_area_struct *vma)
        prot = vma->vm_page_prot;
 
        if (entry->mmap_type != HNS_ROCE_MMAP_TYPE_TPTR)
-               prot = pgprot_noncached(prot);
+               prot = pgprot_device(prot);
 
        ret = rdma_user_mmap_io(uctx, vma, pfn, rdma_entry->npages * PAGE_SIZE,
                                prot, rdma_entry);