All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms
@ 2010-04-08  9:38 Russell King - ARM Linux
  2010-04-09 13:47 ` Russell King - ARM Linux
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-04-08  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

Write combining/cached device mappings are not setting the shared bit,
which could potentially cause problems on SMP systems since the cache
lines won't participate in the cache coherency protocol.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--
This doesn't make it any more legal to use ioremap*() on main system
RAM than it was before this change; it does mean that ioremap_wc()
regions are correctly marked as shared which happens to agree with
the main system RAM mappings.  Strictly to the arch. spec. for ARMv6+,
it remains "unpredictable" to use ioremap*() on main system RAM.

 arch/arm/mm/mmu.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 9d4da6a..4223d08 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -420,6 +420,10 @@ static void __init build_mem_type_table(void)
 		user_pgprot |= L_PTE_SHARED;
 		kern_pgprot |= L_PTE_SHARED;
 		vecs_pgprot |= L_PTE_SHARED;
+		mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
+		mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
+		mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
+		mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
 		mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
 		mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
 #endif

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

* [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms
  2010-04-08  9:38 [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms Russell King - ARM Linux
@ 2010-04-09 13:47 ` Russell King - ARM Linux
  2010-04-09 13:57   ` Shilimkar, Santosh
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2010-04-09 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

Santosh,

Any chance of checking this please?  This should result in the query
about the OMAP framebuffer mappings sharedness being resolved.

Thanks.

On Thu, Apr 08, 2010 at 10:38:52AM +0100, Russell King - ARM Linux wrote:
> Write combining/cached device mappings are not setting the shared bit,
> which could potentially cause problems on SMP systems since the cache
> lines won't participate in the cache coherency protocol.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> --
> This doesn't make it any more legal to use ioremap*() on main system
> RAM than it was before this change; it does mean that ioremap_wc()
> regions are correctly marked as shared which happens to agree with
> the main system RAM mappings.  Strictly to the arch. spec. for ARMv6+,
> it remains "unpredictable" to use ioremap*() on main system RAM.
> 
>  arch/arm/mm/mmu.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index 9d4da6a..4223d08 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -420,6 +420,10 @@ static void __init build_mem_type_table(void)
>  		user_pgprot |= L_PTE_SHARED;
>  		kern_pgprot |= L_PTE_SHARED;
>  		vecs_pgprot |= L_PTE_SHARED;
> +		mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
> +		mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
> +		mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
> +		mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
>  		mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
>  		mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
>  #endif
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms
  2010-04-09 13:47 ` Russell King - ARM Linux
@ 2010-04-09 13:57   ` Shilimkar, Santosh
  0 siblings, 0 replies; 3+ messages in thread
From: Shilimkar, Santosh @ 2010-04-09 13:57 UTC (permalink / raw)
  To: linux-arm-kernel

> -----Original Message-----
> From: Russell King - ARM Linux [mailto:linux at arm.linux.org.uk]
> Sent: Friday, April 09, 2010 7:17 PM
> To: Shilimkar, Santosh
> Cc: linux-arm-kernel at lists.infradead.org
> Subject: Re: [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms
> 
> Santosh,
> 
> Any chance of checking this please?  This should result in the query
> about the OMAP framebuffer mappings sharedness being resolved.
> 
Oh Yes. I tested this and it does fix the "shared" bit issue of frame buffer
> 
> On Thu, Apr 08, 2010 at 10:38:52AM +0100, Russell King - ARM Linux wrote:
> > Write combining/cached device mappings are not setting the shared bit,
> > which could potentially cause problems on SMP systems since the cache
> > lines won't participate in the cache coherency protocol.
> >
> > Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> > --
> > This doesn't make it any more legal to use ioremap*() on main system
> > RAM than it was before this change; it does mean that ioremap_wc()
> > regions are correctly marked as shared which happens to agree with
> > the main system RAM mappings.  Strictly to the arch. spec. for ARMv6+,
> > it remains "unpredictable" to use ioremap*() on main system RAM.
> >
> >  arch/arm/mm/mmu.c |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> > index 9d4da6a..4223d08 100644
> > --- a/arch/arm/mm/mmu.c
> > +++ b/arch/arm/mm/mmu.c
> > @@ -420,6 +420,10 @@ static void __init build_mem_type_table(void)
> >  		user_pgprot |= L_PTE_SHARED;
> >  		kern_pgprot |= L_PTE_SHARED;
> >  		vecs_pgprot |= L_PTE_SHARED;
> > +		mem_types[MT_DEVICE_WC].prot_sect |= PMD_SECT_S;
> > +		mem_types[MT_DEVICE_WC].prot_pte |= L_PTE_SHARED;
> > +		mem_types[MT_DEVICE_CACHED].prot_sect |= PMD_SECT_S;
> > +		mem_types[MT_DEVICE_CACHED].prot_pte |= L_PTE_SHARED;
> >  		mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S;
> >  		mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
> >  #endif
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2010-04-09 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08  9:38 [PATCH] Fix ioremap_cached()/ioremap_wc() for SMP platforms Russell King - ARM Linux
2010-04-09 13:47 ` Russell King - ARM Linux
2010-04-09 13:57   ` Shilimkar, Santosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.