summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-08-25 11:24:30 -0700
committerRoland Dreier <rolandd@cisco.com>2006-09-22 15:22:29 -0700
commit367fe711c5dc85dbc3265cf01e34d4d6fbd55f06 (patch)
treeff3b35b84371afd5fbb2b13ea5657bbda71e73df /drivers
parentba11203a11835737df980ef3dd3bd8325b9cc94e (diff)
downloadblackbird-op-linux-367fe711c5dc85dbc3265cf01e34d4d6fbd55f06.tar.gz
blackbird-op-linux-367fe711c5dc85dbc3265cf01e34d4d6fbd55f06.zip
IB/ipath: drop requirement that PIO buffers be mmaped write-only
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_file_ops.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 0b6e7679eefd..e999a46bef9b 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -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;
OpenPOWER on IntegriCloud