IB/qib: Use cache inhibitted and guarded mapping on powerpc
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 29 Apr 2016 13:25:24 +0000 (23:25 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 1 May 2016 08:32:13 +0000 (18:32 +1000)
The driver was requesting for a writethrough mapping. But with those
flags we will end up with an SAO mapping because we now have memory
conherence always enabled. ie, the existing mapping will end up with a
WIMG value 0b1110 which is Strong Access Order.

Update this to use cache inhibitted guarded mapping.

Cc: Doug Ledford <dledford@redhat.com>
Cc: Sean Hefty <sean.hefty@intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/infiniband/hw/qib/qib_file_ops.c
drivers/infiniband/hw/qib/qib_pcie.c

index e449e394963f00d42cd11ecafbca6081f9011bcd..a3d593f546ecb22e6be4733214d2322a6bc67d7f 100644 (file)
@@ -822,10 +822,7 @@ static int mmap_piobufs(struct vm_area_struct *vma,
        phys = dd->physaddr + piobufs;
 
 #if defined(__powerpc__)
-       /* There isn't a generic way to specify writethrough mappings */
-       pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
-       pgprot_val(vma->vm_page_prot) |= _PAGE_WRITETHRU;
-       pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
+       vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
 
        /*
index 4758a3801ae8f916b6a96988b6c88ce5c344c588..6abe1c621aa4220cb8ca554ef6fee42508915ea7 100644 (file)
@@ -144,13 +144,7 @@ int qib_pcie_ddinit(struct qib_devdata *dd, struct pci_dev *pdev,
        addr = pci_resource_start(pdev, 0);
        len = pci_resource_len(pdev, 0);
 
-#if defined(__powerpc__)
-       /* There isn't a generic way to specify writethrough mappings */
-       dd->kregbase = __ioremap(addr, len, _PAGE_NO_CACHE | _PAGE_WRITETHRU);
-#else
        dd->kregbase = ioremap_nocache(addr, len);
-#endif
-
        if (!dd->kregbase)
                return -ENOMEM;