powerpc: Re-order setup_panic()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 5 Jul 2016 05:04:12 +0000 (15:04 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 21 Jul 2016 09:17:23 +0000 (19:17 +1000)
Do it right after probe_machine() since it's about testing ppc_md,
and put the test in the common code.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c
arch/powerpc/kernel/setup_32.c
arch/powerpc/kernel/setup_64.c

index b8ee1c867ee33c26bca46f3dce30322c1ced6ba0..ca9255e3b7635112d44a0996a460688374efe4f2 100644 (file)
@@ -688,6 +688,8 @@ static struct notifier_block ppc_panic_block = {
 
 void __init setup_panic(void)
 {
+       if (!ppc_md.panic)
+               return;
        atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
 }
 
index 58674b60214991c9b4420bcd5cfe247acb06092a..6247a3a4fd4b1f118603964b07aa8ec15e6927af 100644 (file)
@@ -277,6 +277,8 @@ void __init setup_arch(char **cmdline_p)
 
        probe_machine();
 
+       setup_panic();
+
        setup_power_save();
 
        find_legacy_serial_ports();
@@ -288,9 +290,6 @@ void __init setup_arch(char **cmdline_p)
 
        xmon_setup();
 
-       if (ppc_md.panic)
-               setup_panic();
-
        init_mm.start_code = (unsigned long)_stext;
        init_mm.end_code = (unsigned long) _etext;
        init_mm.end_data = (unsigned long) _edata;
index 3fd59bca06f7792aeaedce93aa5646cec3b105ab..f55c25dff02cd146aea5d70c6afa4c670ec3b402 100644 (file)
@@ -649,6 +649,8 @@ void __init setup_arch(char **cmdline_p)
        /* Probe the machine type */
        probe_machine();
 
+       setup_panic();
+
        /*
         * We can discover serial ports now since the above did setup the
         * hash table management for us, thus ioremap works. We do that early
@@ -696,9 +698,6 @@ void __init setup_arch(char **cmdline_p)
         */
        reserve_hugetlb_gpages();
 
-       if (ppc_md.panic)
-               setup_panic();
-
        klp_init_thread_info(&init_thread_info);
 
        init_mm.start_code = (unsigned long)_stext;