diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/kernel/crash.c | 31 | ||||
-rw-r--r-- | arch/ia64/kernel/mca.c | 6 |
2 files changed, 24 insertions, 13 deletions
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index fbe742ad2fde..2b01e5a1f3ce 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c | |||
@@ -24,6 +24,7 @@ int kdump_status[NR_CPUS]; | |||
24 | static atomic_t kdump_cpu_frozen; | 24 | static atomic_t kdump_cpu_frozen; |
25 | atomic_t kdump_in_progress; | 25 | atomic_t kdump_in_progress; |
26 | static int kdump_on_init = 1; | 26 | static int kdump_on_init = 1; |
27 | static int kdump_on_fatal_mca = 1; | ||
27 | 28 | ||
28 | static inline Elf64_Word | 29 | static inline Elf64_Word |
29 | *append_elf_note(Elf64_Word *buf, char *name, unsigned type, void *data, | 30 | *append_elf_note(Elf64_Word *buf, char *name, unsigned type, void *data, |
@@ -148,7 +149,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
148 | struct ia64_mca_notify_die *nd; | 149 | struct ia64_mca_notify_die *nd; |
149 | struct die_args *args = data; | 150 | struct die_args *args = data; |
150 | 151 | ||
151 | if (!kdump_on_init) | 152 | if (!kdump_on_init && !kdump_on_fatal_mca) |
152 | return NOTIFY_DONE; | 153 | return NOTIFY_DONE; |
153 | 154 | ||
154 | if (!ia64_kimage) { | 155 | if (!ia64_kimage) { |
@@ -174,11 +175,14 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
174 | 175 | ||
175 | switch (val) { | 176 | switch (val) { |
176 | case DIE_INIT_MONARCH_PROCESS: | 177 | case DIE_INIT_MONARCH_PROCESS: |
177 | atomic_set(&kdump_in_progress, 1); | 178 | if (kdump_on_init) { |
178 | *(nd->monarch_cpu) = -1; | 179 | atomic_set(&kdump_in_progress, 1); |
180 | *(nd->monarch_cpu) = -1; | ||
181 | } | ||
179 | break; | 182 | break; |
180 | case DIE_INIT_MONARCH_LEAVE: | 183 | case DIE_INIT_MONARCH_LEAVE: |
181 | machine_kdump_on_init(); | 184 | if (kdump_on_init) |
185 | machine_kdump_on_init(); | ||
182 | break; | 186 | break; |
183 | case DIE_INIT_SLAVE_LEAVE: | 187 | case DIE_INIT_SLAVE_LEAVE: |
184 | if (atomic_read(&kdump_in_progress)) | 188 | if (atomic_read(&kdump_in_progress)) |
@@ -189,16 +193,19 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
189 | unw_init_running(kdump_cpu_freeze, NULL); | 193 | unw_init_running(kdump_cpu_freeze, NULL); |
190 | break; | 194 | break; |
191 | case DIE_MCA_MONARCH_LEAVE: | 195 | case DIE_MCA_MONARCH_LEAVE: |
192 | /* die_register->signr indicate if MCA is recoverable */ | 196 | /* die_register->signr indicate if MCA is recoverable */ |
193 | if (!args->signr) | 197 | if (kdump_on_fatal_mca && !args->signr) { |
198 | atomic_set(&kdump_in_progress, 1); | ||
199 | *(nd->monarch_cpu) = -1; | ||
194 | machine_kdump_on_init(); | 200 | machine_kdump_on_init(); |
201 | } | ||
195 | break; | 202 | break; |
196 | } | 203 | } |
197 | return NOTIFY_DONE; | 204 | return NOTIFY_DONE; |
198 | } | 205 | } |
199 | 206 | ||
200 | #ifdef CONFIG_SYSCTL | 207 | #ifdef CONFIG_SYSCTL |
201 | static ctl_table kdump_on_init_table[] = { | 208 | static ctl_table kdump_ctl_table[] = { |
202 | { | 209 | { |
203 | .ctl_name = CTL_UNNUMBERED, | 210 | .ctl_name = CTL_UNNUMBERED, |
204 | .procname = "kdump_on_init", | 211 | .procname = "kdump_on_init", |
@@ -207,6 +214,14 @@ static ctl_table kdump_on_init_table[] = { | |||
207 | .mode = 0644, | 214 | .mode = 0644, |
208 | .proc_handler = &proc_dointvec, | 215 | .proc_handler = &proc_dointvec, |
209 | }, | 216 | }, |
217 | { | ||
218 | .ctl_name = CTL_UNNUMBERED, | ||
219 | .procname = "kdump_on_fatal_mca", | ||
220 | .data = &kdump_on_fatal_mca, | ||
221 | .maxlen = sizeof(int), | ||
222 | .mode = 0644, | ||
223 | .proc_handler = &proc_dointvec, | ||
224 | }, | ||
210 | { .ctl_name = 0 } | 225 | { .ctl_name = 0 } |
211 | }; | 226 | }; |
212 | 227 | ||
@@ -215,7 +230,7 @@ static ctl_table sys_table[] = { | |||
215 | .ctl_name = CTL_KERN, | 230 | .ctl_name = CTL_KERN, |
216 | .procname = "kernel", | 231 | .procname = "kernel", |
217 | .mode = 0555, | 232 | .mode = 0555, |
218 | .child = kdump_on_init_table, | 233 | .child = kdump_ctl_table, |
219 | }, | 234 | }, |
220 | { .ctl_name = 0 } | 235 | { .ctl_name = 0 } |
221 | }; | 236 | }; |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 6c18221dba36..338dbb8c2cfc 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -1266,16 +1266,12 @@ ia64_mca_handler(struct pt_regs *regs, struct switch_stack *sw, | |||
1266 | } else { | 1266 | } else { |
1267 | /* Dump buffered message to console */ | 1267 | /* Dump buffered message to console */ |
1268 | ia64_mlogbuf_finish(1); | 1268 | ia64_mlogbuf_finish(1); |
1269 | #ifdef CONFIG_KEXEC | ||
1270 | atomic_set(&kdump_in_progress, 1); | ||
1271 | monarch_cpu = -1; | ||
1272 | #endif | ||
1273 | } | 1269 | } |
1270 | |||
1274 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) | 1271 | if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) |
1275 | == NOTIFY_STOP) | 1272 | == NOTIFY_STOP) |
1276 | ia64_mca_spin(__func__); | 1273 | ia64_mca_spin(__func__); |
1277 | 1274 | ||
1278 | |||
1279 | if (atomic_dec_return(&mca_count) > 0) { | 1275 | if (atomic_dec_return(&mca_count) > 0) { |
1280 | int i; | 1276 | int i; |
1281 | 1277 | ||