Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbbBXDcI (ORCPT ); Mon, 23 Feb 2015 22:32:08 -0500 Received: from ozlabs.org ([103.22.144.67]:58672 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752411AbbBXDan (ORCPT ); Mon, 23 Feb 2015 22:30:43 -0500 From: Anton Blanchard To: Andrew Morton , Steven Rostedt , Michael Ellerman , Paul Mackerras , Benjamin Herrenschmidt , sam.bobroff@au1.ibm.com, Thomas Gleixner , Ingo Molnar , hpa@zytor.com, Russell King , peterz@infradead.org, Don Zickus Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: [PATCH 2/7] powerpc: Use die_spin_lock_{irqsave,irqrestore} Date: Tue, 24 Feb 2015 14:30:29 +1100 Message-Id: <1424748634-9153-3-git-send-email-anton@samba.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1424748634-9153-1-git-send-email-anton@samba.org> References: <1424748634-9153-1-git-send-email-anton@samba.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2237 Lines: 78 Replace the powerpc specific oops locking with the common one. Signed-off-by: Anton Blanchard --- arch/powerpc/kernel/traps.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 19e4744..4cc1e72 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -109,14 +110,10 @@ static void pmac_backlight_unblank(void) static inline void pmac_backlight_unblank(void) { } #endif -static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; -static int die_owner = -1; -static unsigned int die_nest_count; static int die_counter; static unsigned __kprobes long oops_begin(struct pt_regs *regs) { - int cpu; unsigned long flags; if (debugger(regs)) @@ -124,17 +121,7 @@ static unsigned __kprobes long oops_begin(struct pt_regs *regs) oops_enter(); - /* racy, but better than risking deadlock. */ - raw_local_irq_save(flags); - cpu = smp_processor_id(); - if (!arch_spin_trylock(&die_lock)) { - if (cpu == die_owner) - /* nested oops. should stop eventually */; - else - arch_spin_lock(&die_lock); - } - die_nest_count++; - die_owner = cpu; + die_spin_lock_irqsave(flags); console_verbose(); bust_spinlocks(1); if (machine_is(powermac)) @@ -146,15 +133,10 @@ static void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) { bust_spinlocks(0); - die_owner = -1; add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE); - die_nest_count--; oops_exit(); printk("\n"); - if (!die_nest_count) - /* Nest count reaches zero, release the lock. */ - arch_spin_unlock(&die_lock); - raw_local_irq_restore(flags); + die_spin_unlock_irqrestore(flags); crash_fadump(regs, "die oops"); -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/