aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/machine_kexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/machine_kexec.c')
-rw-r--r--arch/powerpc/kernel/machine_kexec.c41
1 files changed, 35 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index dd6c141f1662..7ee50f0547cb 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -14,16 +14,41 @@
14#include <linux/threads.h> 14#include <linux/threads.h>
15#include <linux/memblock.h> 15#include <linux/memblock.h>
16#include <linux/of.h> 16#include <linux/of.h>
17#include <linux/irq.h>
18#include <linux/ftrace.h>
19
17#include <asm/machdep.h> 20#include <asm/machdep.h>
18#include <asm/prom.h> 21#include <asm/prom.h>
19#include <asm/sections.h> 22#include <asm/sections.h>
20 23
24void machine_kexec_mask_interrupts(void) {
25 unsigned int i;
26
27 for_each_irq(i) {
28 struct irq_desc *desc = irq_to_desc(i);
29 struct irq_chip *chip;
30
31 if (!desc)
32 continue;
33
34 chip = irq_desc_get_chip(desc);
35 if (!chip)
36 continue;
37
38 if (chip->irq_eoi && irqd_irq_inprogress(&desc->irq_data))
39 chip->irq_eoi(&desc->irq_data);
40
41 if (chip->irq_mask)
42 chip->irq_mask(&desc->irq_data);
43
44 if (chip->irq_disable && !irqd_irq_disabled(&desc->irq_data))
45 chip->irq_disable(&desc->irq_data);
46 }
47}
48
21void machine_crash_shutdown(struct pt_regs *regs) 49void machine_crash_shutdown(struct pt_regs *regs)
22{ 50{
23 if (ppc_md.machine_crash_shutdown) 51 default_machine_crash_shutdown(regs);
24 ppc_md.machine_crash_shutdown(regs);
25 else
26 default_machine_crash_shutdown(regs);
27} 52}
28 53
29/* 54/*
@@ -41,8 +66,6 @@ int machine_kexec_prepare(struct kimage *image)
41 66
42void machine_kexec_cleanup(struct kimage *image) 67void machine_kexec_cleanup(struct kimage *image)
43{ 68{
44 if (ppc_md.machine_kexec_cleanup)
45 ppc_md.machine_kexec_cleanup(image);
46} 69}
47 70
48void arch_crash_save_vmcoreinfo(void) 71void arch_crash_save_vmcoreinfo(void)
@@ -63,11 +86,17 @@ void arch_crash_save_vmcoreinfo(void)
63 */ 86 */
64void machine_kexec(struct kimage *image) 87void machine_kexec(struct kimage *image)
65{ 88{
89 int save_ftrace_enabled;
90
91 save_ftrace_enabled = __ftrace_enabled_save();
92
66 if (ppc_md.machine_kexec) 93 if (ppc_md.machine_kexec)
67 ppc_md.machine_kexec(image); 94 ppc_md.machine_kexec(image);
68 else 95 else
69 default_machine_kexec(image); 96 default_machine_kexec(image);
70 97
98 __ftrace_enabled_restore(save_ftrace_enabled);
99
71 /* Fall back to normal restart if we're still alive. */ 100 /* Fall back to normal restart if we're still alive. */
72 machine_restart(NULL); 101 machine_restart(NULL);
73 for(;;); 102 for(;;);