diff options
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 2075322cd225..9d213542a48b 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -704,6 +704,30 @@ int check_legacy_ioport(unsigned long base_port) | |||
| 704 | } | 704 | } |
| 705 | EXPORT_SYMBOL(check_legacy_ioport); | 705 | EXPORT_SYMBOL(check_legacy_ioport); |
| 706 | 706 | ||
| 707 | static int ppc_panic_event(struct notifier_block *this, | ||
| 708 | unsigned long event, void *ptr) | ||
| 709 | { | ||
| 710 | /* | ||
| 711 | * If firmware-assisted dump has been registered then trigger | ||
| 712 | * firmware-assisted dump and let firmware handle everything else. | ||
| 713 | */ | ||
| 714 | crash_fadump(NULL, ptr); | ||
| 715 | ppc_md.panic(ptr); /* May not return */ | ||
| 716 | return NOTIFY_DONE; | ||
| 717 | } | ||
| 718 | |||
| 719 | static struct notifier_block ppc_panic_block = { | ||
| 720 | .notifier_call = ppc_panic_event, | ||
| 721 | .priority = INT_MIN /* may not return; must be done last */ | ||
| 722 | }; | ||
| 723 | |||
| 724 | void __init setup_panic(void) | ||
| 725 | { | ||
| 726 | if (!ppc_md.panic) | ||
| 727 | return; | ||
| 728 | atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); | ||
| 729 | } | ||
| 730 | |||
| 707 | #ifdef CONFIG_CHECK_CACHE_COHERENCY | 731 | #ifdef CONFIG_CHECK_CACHE_COHERENCY |
| 708 | /* | 732 | /* |
| 709 | * For platforms that have configurable cache-coherency. This function | 733 | * For platforms that have configurable cache-coherency. This function |
| @@ -848,6 +872,9 @@ void __init setup_arch(char **cmdline_p) | |||
| 848 | /* Probe the machine type, establish ppc_md. */ | 872 | /* Probe the machine type, establish ppc_md. */ |
| 849 | probe_machine(); | 873 | probe_machine(); |
| 850 | 874 | ||
| 875 | /* Setup panic notifier if requested by the platform. */ | ||
| 876 | setup_panic(); | ||
| 877 | |||
| 851 | /* | 878 | /* |
| 852 | * Configure ppc_md.power_save (ppc32 only, 64-bit machines do | 879 | * Configure ppc_md.power_save (ppc32 only, 64-bit machines do |
| 853 | * it from their respective probe() function. | 880 | * it from their respective probe() function. |
