IB/ipath: drop requirement that PIO buffers be mmaped write-only
authorBryan O'Sullivan <bos@pathscale.com>
Fri, 25 Aug 2006 18:24:30 +0000 (11:24 -0700)
committerRoland Dreier <rolandd@cisco.com>
Fri, 22 Sep 2006 22:22:29 +0000 (15:22 -0700)
Some userlands try to mmap these pages read-write, so accommodate them.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ipath/ipath_file_ops.c

index 0b6e7679eefd5400f98a6acd1dabc59151faba14..e999a46bef9beb72d50c352aed2fb893e6a55663 100644 (file)
@@ -992,15 +992,10 @@ static int mmap_piobufs(struct vm_area_struct *vma,
        pgprot_val(vma->vm_page_prot) &= ~_PAGE_GUARDED;
 #endif
 
-       if (vma->vm_flags & VM_READ) {
-               dev_info(&dd->pcidev->dev,
-                        "Can't map piobufs as readable (flags=%lx)\n",
-                        vma->vm_flags);
-               ret = -EPERM;
-               goto bail;
-       }
-
-       /* don't allow them to later change to readable with mprotect */
+       /*
+        * don't allow them to later change to readable with mprotect (for when
+        * not initially mapped readable, as is normally the case)
+        */
        vma->vm_flags &= ~VM_MAYREAD;
        vma->vm_flags |= VM_DONTCOPY | VM_DONTEXPAND;