Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
[linux-2.6-block.git] / arch / powerpc / kernel / traps.c
index ca7ce85ebc2efc73476250e520d554abcf121ba0..3031fc712ad03fec600e0caa042c16c5ae6d691a 100644 (file)
@@ -855,12 +855,15 @@ void __kprobes program_check_exception(struct pt_regs *regs)
                return;
        }
        if (reason & REASON_TRAP) {
+               /* Debugger is first in line to stop recursive faults in
+                * rcu_lock, notify_die, or atomic_notifier_call_chain */
+               if (debugger_bpt(regs))
+                       return;
+
                /* trap exception */
                if (notify_die(DIE_BPT, "breakpoint", regs, 5, 5, SIGTRAP)
                                == NOTIFY_STOP)
                        return;
-               if (debugger_bpt(regs))
-                       return;
 
                if (!(regs->msr & MSR_PR) &&  /* not user-mode */
                    report_bug(regs->nip, regs) == BUG_TRAP_TYPE_WARN) {