From patchwork Wed Jul 7 17:13:20 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 58133 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DA848B6EE8 for ; Thu, 8 Jul 2010 03:14:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755129Ab0GGRNw (ORCPT ); Wed, 7 Jul 2010 13:13:52 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:41397 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754208Ab0GGRNv (ORCPT ); Wed, 7 Jul 2010 13:13:51 -0400 Received: by mail-wy0-f174.google.com with SMTP id 23so3418903wyf.19 for ; Wed, 07 Jul 2010 10:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=H4PTQV9B+U2UOH/WFJfxo0v8P8CHjLK+oapgkBgRw8c=; b=k+PtGeoQJy5DuqCQBLnuXmy2o5btGtFvHBSLgB2UvWqGk9KPGOAE7mig4x/4V1l+ev JurBS7w2U9ZSSETDlRUAnmGVzxZ7W3SZEhi35iVqu7e1Nkm70E+xNK5jh36A+PicSPIP g5Yx6frGkBA10tjyu8sbxt3reqM6K4azsyBzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=oVd9HdtbbfpxRLEqggMQsG6KB3Sv4hN0pTlP2MVk5wsXjYTWx2zx7kiebYff4eDjIB h65+4jOWifdKcB90F0EikHVXZEaAIxZxIHcw5nQ9az19X8djWVi6L1LJyaQNJGPft/cJ roCedJiaVBBQVJ/BSTbllxCf8UUF8YfFjIujI= Received: by 10.213.4.5 with SMTP id 5mr6191812ebp.94.1278522803548; Wed, 07 Jul 2010 10:13:23 -0700 (PDT) Received: from localhost (mail.dev.rtsoft.ru [213.79.90.226]) by mx.google.com with ESMTPS id x54sm62896204eeh.5.2010.07.07.10.13.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Jul 2010 10:13:22 -0700 (PDT) Date: Wed, 7 Jul 2010 21:13:20 +0400 From: Anton Vorontsov To: kgdb-bugreport@lists.sourceforge.net Cc: Russell King , "David S. Miller" , Jason Wessel , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 2/4] ARM: kgdb: Disable preemption before re-enabling interrupts Message-ID: <20100707171320.GB20015@oksana.dev.rtsoft.ru> References: <20100707171222.GA16448@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: attachment In-Reply-To: <20100707171222.GA16448@oksana.dev.rtsoft.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We have to disable preemption before enabling local IRQs because local_irq_enable() makes it possible for the kernel to reschedule, so the kernel might hit a breakpoint causing itself to re-enter KGDB and die. Signed-off-by: Anton Vorontsov --- arch/arm/kernel/kgdb.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index 5c61100..6ece654 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c @@ -167,9 +167,17 @@ static void kgdb_call_nmi_hook(void *ignored) void kgdb_roundup_cpus(unsigned long flags) { + /* + * We have to disable preemption before enabling local + * IRQs because local_irq_enable() makes it possible for + * the kernel to reschedule, so the kernel might hit a + * breakpoint causing itself to re-enter KGDB and die. + */ + preempt_disable(); local_irq_enable(); smp_call_function(kgdb_call_nmi_hook, NULL, 0); local_irq_disable(); + preempt_enable(); } #ifdef CONFIG_SMP