traps.c (58154c8ce71a7854d969d73468fd00e5eeeab708) traps.c (9b00ac06978c54788f13eefd34a07b77db48d567)
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
3 * Copyright 2007-2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 148 unchanged lines hidden (view full) ---

157
158 bust_spinlocks(0);
159 die.lock_owner = -1;
160 add_taint(TAINT_DIE);
161 oops_exit();
162 printk("\n");
163 raw_spin_unlock_irqrestore(&die.lock, flags);
164
1/*
2 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
3 * Copyright 2007-2010 Freescale Semiconductor, Inc.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.

--- 148 unchanged lines hidden (view full) ---

157
158 bust_spinlocks(0);
159 die.lock_owner = -1;
160 add_taint(TAINT_DIE);
161 oops_exit();
162 printk("\n");
163 raw_spin_unlock_irqrestore(&die.lock, flags);
164
165 if (kexec_should_crash(current) ||
166 kexec_sr_activated(smp_processor_id()))
165 /*
166 * A system reset (0x100) is a request to dump, so we always send
167 * it through the crashdump code.
168 */
169 if (kexec_should_crash(current) || (TRAP(regs) == 0x100)) {
167 crash_kexec(regs);
170 crash_kexec(regs);
168 crash_kexec_secondary(regs);
169
171
172 /*
173 * We aren't the primary crash CPU. We need to send it
174 * to a holding pattern to avoid it ending up in the panic
175 * code.
176 */
177 crash_kexec_secondary(regs);
178 }
179
170 /*
171 * While our oops output is serialised by a spinlock, output
172 * from panic() called below can race and corrupt it. If we
173 * know we are going to panic, delay for 1 second so we have a
174 * chance to get clean backtraces from all CPUs that are oopsing.
175 */
176 if (in_interrupt() || panic_on_oops || !current->pid ||
177 is_global_init(current)) {

--- 49 unchanged lines hidden (view full) ---

227void system_reset_exception(struct pt_regs *regs)
228{
229 /* See if any machine dependent calls */
230 if (ppc_md.system_reset_exception) {
231 if (ppc_md.system_reset_exception(regs))
232 return;
233 }
234
180 /*
181 * While our oops output is serialised by a spinlock, output
182 * from panic() called below can race and corrupt it. If we
183 * know we are going to panic, delay for 1 second so we have a
184 * chance to get clean backtraces from all CPUs that are oopsing.
185 */
186 if (in_interrupt() || panic_on_oops || !current->pid ||
187 is_global_init(current)) {

--- 49 unchanged lines hidden (view full) ---

237void system_reset_exception(struct pt_regs *regs)
238{
239 /* See if any machine dependent calls */
240 if (ppc_md.system_reset_exception) {
241 if (ppc_md.system_reset_exception(regs))
242 return;
243 }
244
235#ifdef CONFIG_KEXEC
236 cpumask_set_cpu(smp_processor_id(), &cpus_in_sr);
237#endif
238
239 die("System Reset", regs, SIGABRT);
240
245 die("System Reset", regs, SIGABRT);
246
241 /*
242 * Some CPUs when released from the debugger will execute this path.
243 * These CPUs entered the debugger via a soft-reset. If the CPU was
244 * hung before entering the debugger it will return to the hung
245 * state when exiting this function. This causes a problem in
246 * kdump since the hung CPU(s) will not respond to the IPI sent
247 * from kdump. To prevent the problem we call crash_kexec_secondary()
248 * here. If a kdump had not been initiated or we exit the debugger
249 * with the "exit and recover" command (x) crash_kexec_secondary()
250 * will return after 5ms and the CPU returns to its previous state.
251 */
252 crash_kexec_secondary(regs);
253
254 /* Must die if the interrupt is not recoverable */
255 if (!(regs->msr & MSR_RI))
256 panic("Unrecoverable System Reset");
257
258 /* What should we do here? We could issue a shutdown or hard reset. */
259}
260#endif
261

--- 1342 unchanged lines hidden ---
247 /* Must die if the interrupt is not recoverable */
248 if (!(regs->msr & MSR_RI))
249 panic("Unrecoverable System Reset");
250
251 /* What should we do here? We could issue a shutdown or hard reset. */
252}
253#endif
254

--- 1342 unchanged lines hidden ---