UIO: add pgprot_noncached() to UIO mmap code
authorJean-Samuel Chenard <jsamch@gmail.com>
Fri, 14 Mar 2008 10:28:36 +0000 (11:28 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 25 Mar 2008 05:33:49 +0000 (22:33 -0700)
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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/uio/uio.c

index e8a01f264540e1cb9675eb821e0f3769c7a9667c..11759080ca547058809b516aaacbc8f979ff77d5 100644 (file)
@@ -470,6 +470,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,