linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [POWERPC] Reintroduce O_SYNC flag to make DRAM non-cached.
@ 2008-05-08  5:26 nick.spence
  2008-05-08  5:50 ` Paul Mackerras
  0 siblings, 1 reply; 7+ messages in thread
From: nick.spence @ 2008-05-08  5:26 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nick Spence

From: Nick Spence <nick.spence@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@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)
 				    | _PAGE_GUARDED | _PAGE_NO_CACHE);
 	return vma_prot;
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-08  9:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-08  5:26 [PATCH] [POWERPC] Reintroduce O_SYNC flag to make DRAM non-cached nick.spence
2008-05-08  5:50 ` Paul Mackerras
2008-05-08  6:31   ` Spence Nick
2008-05-08  6:55     ` Benjamin Herrenschmidt
2008-05-08  7:17       ` Nick Spence
2008-05-08  7:21         ` Benjamin Herrenschmidt
2008-05-08  9:54     ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).