]> git.hungrycats.org Git - linux/commitdiff
UIO: add pgprot_noncached() to UIO mmap code
authorJean-Samuel Chenard <jsamch@gmail.com>
Tue, 25 Mar 2008 06:35:08 +0000 (06:35 +0000)
committerChris Wright <chrisw@sous-sol.org>
Sat, 19 Apr 2008 01:53:19 +0000 (18:53 -0700)
upstream commit: c9698d6b1a90929e427a165bd8283f803f57d9bd

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.

Signed-off-by: Jean-Samuel Chenard <jsamch@gmail.com>
Signed-off-by: Hans J Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/uio/uio.c

index 865f32b63b5c0d2d468348f77a1c2c8c07d34879..b4e10225aa61e737799b030c2ac01d5cbefcc202 100644 (file)
@@ -447,6 +447,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
 
        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,