diff options
author | Tony Luck <tony.luck@intel.com> | 2008-04-17 13:14:51 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-04-17 13:14:51 -0400 |
commit | 71b264f85ff50c14fe945ffff06ae0d5e9a9124e (patch) | |
tree | 9fd79c63fd630c4d030a97d254d42a3a73f1328b /arch/ia64/kernel/crash.c | |
parent | f4df39cbdd9e9ab615e80148cc271db22a8508ad (diff) | |
parent | 072f042df335d7e0da2027637bcf720d7ff1589b (diff) |
Pull miscellaneous into release branch
Conflicts:
arch/ia64/kernel/mca.c
Diffstat (limited to 'arch/ia64/kernel/crash.c')
-rw-r--r-- | arch/ia64/kernel/crash.c | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index fbe742ad2fde..90ef338cf46f 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, |
@@ -118,6 +119,7 @@ machine_crash_shutdown(struct pt_regs *pt) | |||
118 | static void | 119 | static void |
119 | machine_kdump_on_init(void) | 120 | machine_kdump_on_init(void) |
120 | { | 121 | { |
122 | crash_save_vmcoreinfo(); | ||
121 | local_irq_disable(); | 123 | local_irq_disable(); |
122 | kexec_disable_iosapic(); | 124 | kexec_disable_iosapic(); |
123 | machine_kexec(ia64_kimage); | 125 | machine_kexec(ia64_kimage); |
@@ -148,7 +150,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
148 | struct ia64_mca_notify_die *nd; | 150 | struct ia64_mca_notify_die *nd; |
149 | struct die_args *args = data; | 151 | struct die_args *args = data; |
150 | 152 | ||
151 | if (!kdump_on_init) | 153 | if (!kdump_on_init && !kdump_on_fatal_mca) |
152 | return NOTIFY_DONE; | 154 | return NOTIFY_DONE; |
153 | 155 | ||
154 | if (!ia64_kimage) { | 156 | if (!ia64_kimage) { |
@@ -173,32 +175,38 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) | |||
173 | return NOTIFY_DONE; | 175 | return NOTIFY_DONE; |
174 | 176 | ||
175 | switch (val) { | 177 | switch (val) { |
176 | case DIE_INIT_MONARCH_PROCESS: | 178 | case DIE_INIT_MONARCH_PROCESS: |
179 | if (kdump_on_init) { | ||
177 | atomic_set(&kdump_in_progress, 1); | 180 | atomic_set(&kdump_in_progress, 1); |
178 | *(nd->monarch_cpu) = -1; | 181 | *(nd->monarch_cpu) = -1; |
179 | break; | 182 | } |
180 | case DIE_INIT_MONARCH_LEAVE: | 183 | break; |
184 | case DIE_INIT_MONARCH_LEAVE: | ||
185 | if (kdump_on_init) | ||
181 | machine_kdump_on_init(); | 186 | machine_kdump_on_init(); |
182 | break; | 187 | break; |
183 | case DIE_INIT_SLAVE_LEAVE: | 188 | case DIE_INIT_SLAVE_LEAVE: |
184 | if (atomic_read(&kdump_in_progress)) | 189 | if (atomic_read(&kdump_in_progress)) |
185 | unw_init_running(kdump_cpu_freeze, NULL); | 190 | unw_init_running(kdump_cpu_freeze, NULL); |
186 | break; | 191 | break; |
187 | case DIE_MCA_RENDZVOUS_LEAVE: | 192 | case DIE_MCA_RENDZVOUS_LEAVE: |
188 | if (atomic_read(&kdump_in_progress)) | 193 | if (atomic_read(&kdump_in_progress)) |
189 | unw_init_running(kdump_cpu_freeze, NULL); | 194 | unw_init_running(kdump_cpu_freeze, NULL); |
190 | break; | 195 | break; |
191 | case DIE_MCA_MONARCH_LEAVE: | 196 | case DIE_MCA_MONARCH_LEAVE: |
192 | /* die_register->signr indicate if MCA is recoverable */ | 197 | /* die_register->signr indicate if MCA is recoverable */ |
193 | if (!args->signr) | 198 | if (kdump_on_fatal_mca && !args->signr) { |
194 | machine_kdump_on_init(); | 199 | atomic_set(&kdump_in_progress, 1); |
195 | break; | 200 | *(nd->monarch_cpu) = -1; |
201 | machine_kdump_on_init(); | ||
202 | } | ||
203 | break; | ||
196 | } | 204 | } |
197 | return NOTIFY_DONE; | 205 | return NOTIFY_DONE; |
198 | } | 206 | } |
199 | 207 | ||
200 | #ifdef CONFIG_SYSCTL | 208 | #ifdef CONFIG_SYSCTL |
201 | static ctl_table kdump_on_init_table[] = { | 209 | static ctl_table kdump_ctl_table[] = { |
202 | { | 210 | { |
203 | .ctl_name = CTL_UNNUMBERED, | 211 | .ctl_name = CTL_UNNUMBERED, |
204 | .procname = "kdump_on_init", | 212 | .procname = "kdump_on_init", |
@@ -207,6 +215,14 @@ static ctl_table kdump_on_init_table[] = { | |||
207 | .mode = 0644, | 215 | .mode = 0644, |
208 | .proc_handler = &proc_dointvec, | 216 | .proc_handler = &proc_dointvec, |
209 | }, | 217 | }, |
218 | { | ||
219 | .ctl_name = CTL_UNNUMBERED, | ||
220 | .procname = "kdump_on_fatal_mca", | ||
221 | .data = &kdump_on_fatal_mca, | ||
222 | .maxlen = sizeof(int), | ||
223 | .mode = 0644, | ||
224 | .proc_handler = &proc_dointvec, | ||
225 | }, | ||
210 | { .ctl_name = 0 } | 226 | { .ctl_name = 0 } |
211 | }; | 227 | }; |
212 | 228 | ||
@@ -215,7 +231,7 @@ static ctl_table sys_table[] = { | |||
215 | .ctl_name = CTL_KERN, | 231 | .ctl_name = CTL_KERN, |
216 | .procname = "kernel", | 232 | .procname = "kernel", |
217 | .mode = 0555, | 233 | .mode = 0555, |
218 | .child = kdump_on_init_table, | 234 | .child = kdump_ctl_table, |
219 | }, | 235 | }, |
220 | { .ctl_name = 0 } | 236 | { .ctl_name = 0 } |
221 | }; | 237 | }; |