Skip to content

Commit

Permalink
powerpc: Re-order setup_panic()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt authored and Michael Ellerman committed Jul 21, 2016
1 parent e39afba commit f7b9ebb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
5 changes: 2 additions & 3 deletions arch/powerpc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ void __init setup_arch(char **cmdline_p)

probe_machine();

setup_panic();

setup_power_save();

find_legacy_serial_ports();
Expand All @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f7b9ebb

Please sign in to comment.