]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc/44x: don't use tlbivax on AMP systems
authorDave Kleikamp <shaggy@linux.vnet.ibm.com>
Mon, 4 Jul 2011 18:38:03 +0000 (18:38 +0000)
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>
Tue, 12 Jul 2011 13:21:55 +0000 (09:21 -0400)
Since other OS's may be running on the other cores don't use tlbivax

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
arch/powerpc/include/asm/mmu.h
arch/powerpc/kernel/setup_32.c
arch/powerpc/mm/tlb_hash32.c
arch/powerpc/mm/tlb_nohash.c

index 4138b21ae80afeb216da9cf6b7ab1e5ca8247a3a..bb5591f424b3158032d1675183247b0e51420e53 100644 (file)
@@ -120,9 +120,14 @@ static inline int mmu_has_feature(unsigned long feature)
        return (cur_cpu_spec->mmu_features & feature);
 }
 
+static inline void mmu_clear_feature(unsigned long feature)
+{
+       cur_cpu_spec->mmu_features &= ~feature;
+}
+
 extern unsigned int __start___mmu_ftr_fixup, __stop___mmu_ftr_fixup;
 
-/* MMU initialization (64-bit only fo now) */
+/* MMU initialization */
 extern void early_init_mmu(void);
 extern void early_init_mmu_secondary(void);
 
index 1d2fbc905303401c50bbd410da0118338cb05eb7..7544e39b41562dcba9c141cf4dc9e73cd1810e81 100644 (file)
@@ -126,6 +126,8 @@ notrace void __init machine_init(unsigned long dt_ptr)
        /* Do some early initialization based on the flat device tree */
        early_init_devtree(__va(dt_ptr));
 
+       early_init_mmu();
+
        probe_machine();
 
        setup_kdump_trampoline();
index 27b863c14941a9406ced93e2f534825171d2bf85..9a445f64accd086fa549f0cd750ac999b7669eab 100644 (file)
@@ -177,3 +177,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
        flush_range(vma->vm_mm, start, end);
 }
 EXPORT_SYMBOL(flush_tlb_range);
+
+void __init early_init_mmu(void)
+{
+}
index 3722185d1865eac30a8f7c0ffd7edb624fa906a2..7355211b93b39d00ccae72a6555a2e1877eb86bd 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/preempt.h>
 #include <linux/spinlock.h>
 #include <linux/memblock.h>
+#include <linux/of_fdt.h>
 
 #include <asm/tlbflush.h>
 #include <asm/tlb.h>
@@ -266,6 +267,17 @@ EXPORT_SYMBOL(flush_tlb_page);
 
 #endif /* CONFIG_SMP */
 
+#ifdef CONFIG_PPC_47x
+void __init early_init_mmu_47x(void)
+{
+#ifdef CONFIG_SMP
+       unsigned long root = of_get_flat_dt_root();
+       if (of_get_flat_dt_prop(root, "cooperative-partition", NULL))
+               mmu_clear_feature(MMU_FTR_USE_TLBIVAX_BCAST);
+#endif /* CONFIG_SMP */
+}
+#endif /* CONFIG_PPC_47x */
+
 /*
  * Flush kernel TLB entries in the given range
  */
@@ -593,4 +605,11 @@ void setup_initial_memory_limit(phys_addr_t first_memblock_base,
        /* Finally limit subsequent allocations */
        memblock_set_current_limit(first_memblock_base + ppc64_rma_size);
 }
+#else /* ! CONFIG_PPC64 */
+void __init early_init_mmu(void)
+{
+#ifdef CONFIG_PPC_47x
+       early_init_mmu_47x();
+#endif
+}
 #endif /* CONFIG_PPC64 */