From patchwork Thu Aug 14 11:15:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 35399 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 339A4203C5 for ; Thu, 14 Aug 2014 11:16:12 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id w10sf7166982pde.7 for ; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=+45E1PpbAohMcVbX2SlZzfbbtVHqg6Ik9yuCWpfbLvk=; b=PCcp2GnrLjMR2pvMp1frIGA5dZ9VD3D053YDx20gC86L5oBIPI7OJUrrpXWZ4BDICC Vr+aVQPXhmEnFYTsVu20fs9sqvEliNr8Z3ezLcsbv71yQypUe8nlcQHaHRNav+GHwWHj Kznzd7bh044WIV+lhNNzP16QW7+bwEYtjQh/rEqmH90IxTRwboM9f7SEzs6YRxP8DvCC oku0srHOyB1hgY06hjWhBtoOkEIK2n8fZtKNU3O2iQD352PTeC1MEIdtHeK+se7nywcd ZqDwxXiT0Oq2R6cGqAukwtf3bOpyh19oqwCQ2eqkkON3F+hoyN3hzQIC5Wc2Fw87TMnH m5Ow== X-Gm-Message-State: ALoCoQlxYQ+ZNk/3CZ10ox/BOUmnrYhQ0xUJLKu/p28ZGRg98LzLa/sKzHVQvwI5nQCnHFlurQEF X-Received: by 10.66.141.165 with SMTP id rp5mr24750pab.47.1408014971518; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.176 with SMTP id 45ls898819qgx.16.gmail; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) X-Received: by 10.52.185.193 with SMTP id fe1mr7450849vdc.31.1408014971333; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id q3si795680ves.44.2014.08.14.04.16.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 04:16:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so1159483vcb.40 for ; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) X-Received: by 10.220.187.134 with SMTP id cw6mr64587vcb.71.1408014971246; Thu, 14 Aug 2014 04:16:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp25105vcb; Thu, 14 Aug 2014 04:16:09 -0700 (PDT) X-Received: by 10.194.123.129 with SMTP id ma1mr11521429wjb.80.1408014967445; Thu, 14 Aug 2014 04:16:07 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id qm2si5879287wjc.59.2014.08.14.04.16.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Aug 2014 04:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.178 as permitted sender) client-ip=74.125.82.178; Received: by mail-we0-f178.google.com with SMTP id w61so948912wes.9 for ; Thu, 14 Aug 2014 04:16:04 -0700 (PDT) X-Received: by 10.180.21.235 with SMTP id y11mr11047647wie.75.1408014964563; Thu, 14 Aug 2014 04:16:04 -0700 (PDT) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id gb5sm18966593wib.8.2014.08.14.04.16.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 04:16:03 -0700 (PDT) From: Daniel Thompson To: Russell King Cc: Daniel Thompson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com, Rob Herring , Linus Walleij , Ben Dooks , Catalin Marinas , Dave Martin , Fabio Estevam , Frederic Weisbecker , Nicolas Pitre Subject: [RFC PATCH 2/3] arm: kgdb: Add support for IPI FIQ roundup Date: Thu, 14 Aug 2014 12:15:50 +0100 Message-Id: <1408014951-24820-3-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408014951-24820-1-git-send-email-daniel.thompson@linaro.org> References: <53EC9404.5010908@linaro.org> <1408014951-24820-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Rounding up the other CPUs using FIQ improves debugger robustness. Signed-off-by: Daniel Thompson --- arch/arm/include/asm/kgdb.h | 1 + arch/arm/kernel/kgdb.c | 20 ++++++++++++++++---- arch/arm/kernel/kgdb_fiq.c | 7 ++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h index 5de21f01..ceb466f 100644 --- a/arch/arm/include/asm/kgdb.h +++ b/arch/arm/include/asm/kgdb.h @@ -50,6 +50,7 @@ static inline void arch_kgdb_breakpoint(void) extern void kgdb_handle_bus_error(void); extern int kgdb_fault_expected; +extern int kgdb_fiq_enabled; extern char kgdb_fiq_handler; extern char kgdb_fiq_handler_end; asmlinkage void __exception_irq_entry kgdb_fiq_do_handle(struct pt_regs *regs); diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index a74b53c..e5c3ec0 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c @@ -175,14 +175,26 @@ static struct undef_hook kgdb_compiled_brkpt_hook = { static void kgdb_call_nmi_hook(void *ignored) { - kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); + kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); } void kgdb_roundup_cpus(unsigned long flags) { - local_irq_enable(); - smp_call_function(kgdb_call_nmi_hook, NULL, 0); - local_irq_disable(); +#ifdef CONFIG_FIQ + struct cpumask mask; + + if (kgdb_fiq_enabled) { + cpumask_copy(&mask, cpu_online_mask); + cpumask_clear_cpu(raw_smp_processor_id(), &mask); + if (!cpumask_empty(&mask)) + send_fiq_ipi_mask(&mask); + return; + } +#endif + + local_irq_enable(); + smp_call_function(kgdb_call_nmi_hook, NULL, 0); + local_irq_disable(); } static int __kgdb_notify(struct die_args *args, unsigned long cmd) diff --git a/arch/arm/kernel/kgdb_fiq.c b/arch/arm/kernel/kgdb_fiq.c index a894dde..f7a2c3d 100644 --- a/arch/arm/kernel/kgdb_fiq.c +++ b/arch/arm/kernel/kgdb_fiq.c @@ -24,7 +24,7 @@ #include #include -static int kgdb_fiq_enabled; +int kgdb_fiq_enabled; module_param_named(enable, kgdb_fiq_enabled, int, 0600); MODULE_PARM_DESC(enable, "set to 1 to enable FIQ KGDB"); @@ -40,6 +40,11 @@ asmlinkage void __exception_irq_entry kgdb_fiq_do_handle(struct pt_regs *regs) { int actual; + if (!kgdb_nmicallback(raw_smp_processor_id(), regs)) { + handle_IPI_FIQ(regs); + return; + } + nmi_enter(); actual = ack_fiq(kgdb_fiq); WARN_ON(actual != kgdb_fiq);