diff options
Diffstat (limited to 'arch/ia64/kernel/crash.c')
-rw-r--r-- | arch/ia64/kernel/crash.c | 31 |
1 files changed, 23 insertions, 8 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 | }; |