ARM: Fix ioremap_cached()/ioremap_wc() for SMP platforms
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 9 Apr 2010 14:00:11 +0000 (15:00 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 9 Apr 2010 14:00:11 +0000 (15:00 +0100)
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>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/mm/mmu.c

index 9d4da6ac28ebf9fae8718de70af211beede72156..4223d086aa1768c22f56085c59fb1a73cfb0f5ab 100644 (file)
@@ -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