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

2008-05-08 Thread Segher Boessenkool
We found the problem when porting code from Linux 2.4 to 2.6, where a user space application maps a 1 MByte region of DRAM with the O_SYNC flag to communicate with an internal core that shares access to the DRAM but does not have any cache snooping logic. In 2.4 the mem driver honors the O_SYNC f

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

2008-05-08 Thread Benjamin Herrenschmidt
On Thu, 2008-05-08 at 00:17 -0700, Nick Spence wrote: > The page protection seemed to be allocated on a per pte basis, where > each PTE is a small fixed size. I will need to check the TLB setup > further. The problem is that it will then be part of the linear mapping, which means you'll end up w

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

2008-05-08 Thread Nick Spence
Benjamin Herrenschmidt wrote: On Wed, 2008-05-07 at 23:31 -0700, Spence Nick wrote: Then you should completely carve it out of the LMB's which will ensure it's not seen as RAM by /dev/mem and not mapped by the linear mapping (well, the later depends ... if it's carved out of the top of RAM it sh

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

2008-05-07 Thread Benjamin Herrenschmidt
On Wed, 2008-05-07 at 23:31 -0700, Spence Nick wrote: > > In our case the memory area is reserved so that the main processor will > not touch it except when mapped by the mem driver. Then you should completely carve it out of the LMB's which will ensure it's not seen as RAM by /dev/mem and not m

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

2008-05-07 Thread Spence Nick
Paul Mackerras wrote: > This says nothing about why you want to do this---what bad > things arise from the present code, or what good things would > happen if the change was made. It needs to. We found the problem when porting code from Linux 2.4 to 2.6, where a user space application maps a 1

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

2008-05-07 Thread Paul Mackerras
[EMAIL PROTECTED] writes: > 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 This says nothing about why you want to do this---what bad things arise from the present code, or what good things

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

2008-05-07 Thread nick . spence
From: Nick Spence <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> --- diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c