[PATCH] [POWERPC] Reintroduce O_SYNC flag to make DRAM non-cached.

nick.spence at freescale.com nick.spence at freescale.com
Thu May 8 15:26:32 EST 2008

From: Nick Spence <nick.spence at freescale.com>

This patch re-introduces the O_SYNC flag to make DRAM non-cached, which is the default behavior
for non PowerPC architectures in /drivers/char/mem.c

Signed-off-by: Nick Spence <nick.spence at freescale.com>
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 5ccb579..f994b0a 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) || (!page_is_ram(pfn)))
 		vma_prot = __pgprot(pgprot_val(vma_prot)
 	return vma_prot;

More information about the Linuxppc-dev mailing list