[RFC] powerpc/mm: honor O_SYNC flag for memory map
Li Yang
leoli at freescale.com
Tue Nov 17 18:10:32 EST 2009
Rather than the original intelligent way, we grant user more freedom.
This enables user to map cacheable memory not managed by Linux.
Signed-off-by: Li Yang <leoli at freescale.com>
---
The only direct users of this function is fb_mmap() and /dev/mem mmap.
Although I'm not sure if anything is depending on the intelligent setting of
cacheability.
arch/powerpc/mm/mem.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 579382c..0fd267e 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -101,7 +101,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
if (ppc_md.phys_mem_access_prot)
return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
- if (!page_is_ram(pfn))
+ if (file->f_flags & O_SYNC)
vma_prot = pgprot_noncached(vma_prot);
return vma_prot;
--
1.6.4
More information about the Linuxppc-dev
mailing list