LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] powerpc/mm: honor O_SYNC flag for memory map
@ 2009-11-17  7:10 Li Yang
  2009-11-19 13:55 ` Kumar Gala
  0 siblings, 1 reply; 12+ messages in thread
From: Li Yang @ 2009-11-17  7:10 UTC (permalink / raw)
  To: linuxppc-dev, benh

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@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

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

end of thread, other threads:[~2009-11-30 10:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-17  7:10 [RFC] powerpc/mm: honor O_SYNC flag for memory map Li Yang
2009-11-19 13:55 ` Kumar Gala
2009-11-20  3:00   ` Li Yang-R58472
2009-11-20  9:03     ` Benjamin Herrenschmidt
2009-11-20  9:23       ` Li Yang
2009-11-21 20:01         ` Segher Boessenkool
2009-11-25  8:07           ` Li Yang
2009-11-25 11:30             ` Gabriel Paubert
2009-11-26  7:43               ` Li Yang
2009-11-27  2:30                 ` Paul Mackerras
2009-11-30 10:00                   ` Li Yang
2009-11-26 21:26             ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox