powerpc/mm: Move disable_radix handling into mmu_early_init_devtree()
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 26 Jul 2016 11:29:30 +0000 (21:29 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 1 Aug 2016 01:14:53 +0000 (11:14 +1000)
Move the handling of the disable_radix command line argument into the
newly created mmu_early_init_devtree().

It's an MMU option so it's preferable to have it in an mm related file,
and it also means platforms that don't support radix don't have to carry
the code.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/prom.c
arch/powerpc/mm/init_64.c

index 9686984e79c492568e6e639a8558cae95433f6d9..b4b6952e899180679a264ac6747c6d339ba43575 100644 (file)
@@ -647,14 +647,6 @@ static void __init early_reserve_mem(void)
 #endif
 }
 
-static bool disable_radix;
-static int __init parse_disable_radix(char *p)
-{
-       disable_radix = true;
-       return 0;
-}
-early_param("disable_radix", parse_disable_radix);
-
 void __init early_init_devtree(void *params)
 {
        phys_addr_t limit;
@@ -744,11 +736,6 @@ void __init early_init_devtree(void *params)
         */
        spinning_secondaries = boot_cpu_count - 1;
 #endif
-       /*
-        * now fixup radix MMU mode based on kernel command line
-        */
-       if (disable_radix)
-               cur_cpu_spec->mmu_features &= ~MMU_FTR_RADIX;
 
        mmu_early_init_devtree();
 
index d0fb33ac3db2165a5f80b10082f5fd95e0349804..0d51e6e25db55470d2f3ee670be130f28311cc96 100644 (file)
@@ -413,7 +413,18 @@ EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
 #endif /* CONFIG_SPARSEMEM_VMEMMAP/CONFIG_FLATMEM */
 
 #ifdef CONFIG_PPC_STD_MMU_64
+static bool disable_radix;
+static int __init parse_disable_radix(char *p)
+{
+       disable_radix = true;
+       return 0;
+}
+early_param("disable_radix", parse_disable_radix);
+
 void __init mmu_early_init_devtree(void)
 {
+       /* Disable radix mode based on kernel command line. */
+       if (disable_radix)
+               cur_cpu_spec->mmu_features &= ~MMU_FTR_RADIX;
 }
 #endif /* CONFIG_PPC_STD_MMU_64 */