Skip to contentSkip to conversation

Add pgprot_noncached() to UIO mmap code

PATCH New Hans J. Koch 1 participant 1 message Mar 14, 2008 Userspace I/O (UIO)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add pgprot_noncached() to UIO mmap code

From: Jean-Samuel Chenard <[email protected]>
To: Greg KH <[email protected]>
Cc: Hans J Koch <[email protected]>, [email protected],
Juergen Beisert <[email protected]>
Date: Fri, 14 Mar 2008 11:19:49 +0100
Subject: Add pgprot_noncached() to UIO mmap code

Mapping of physical memory in UIO needs pgprot_noncached() to ensure that IO memory is not cached. Without pgprot_noncached(), it (accidentally) works on x86 and arm, but fails on PPC.

---
 drivers/uio/uio.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/uio/uio.c +2 -0
Index: linux-2.6.25-rc/drivers/uio/uio.c
===================================================================
@@ -470,6 +470,8 @@
 
 	vma->vm_flags |= VM_IO | VM_RESERVED;
 
+	vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+
 	return remap_pfn_range(vma,
 			       vma->vm_start,
 			       idev->info->mem[mi].addr >> PAGE_SHIFT,