From patchwork Mon Jan 5 14:54:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 42747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9066626670 for ; Mon, 5 Jan 2015 14:55:27 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf12207122lab.7 for ; Mon, 05 Jan 2015 06:55:26 -0800 (PST) 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=ipD5rlBtt0mUeIHt6TaNBw2U88EVjlQTGSDUcOUu+/s=; b=PTIVq3xFp8FFkOqtYcLsAVFnlci9tQs0HsI9rxE6NGugRpxovAvynGVgwrWWbmgMDe hoeydKC2bVifLJ3uzPE4eo3O/4P6zU9txbtU4vWa+US7qJwJIzMu4fF7brndL4sl7nmQ jnneRkegdjMfUdj+DKlG2em5R74oM1cSxSGrOX1d5KOrTxMwkkYHEdTUe4m3ulV9Ucxj UsdXSmPOoNWYCAj6oFc+ixD1s7dPytXCdRZW0w6nCA+hC1n1RwtIfGncEhPHkgeEo1kz Rnk0wNlDHoCR8vQWB+uRywmpxaXTG8H3ki5826th6JmPZMBcUJwPadiP/1jgqDPovTVL LtnA== X-Gm-Message-State: ALoCoQkhYyABZkq/FOkNOJMx3J+7TbOnJ84MyRfKMUyXlX7XBoqNNQgc3rRKMCj6h9Un6ZNkEaad X-Received: by 10.152.2.40 with SMTP id 8mr358660lar.7.1420469726514; Mon, 05 Jan 2015 06:55:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.229 with SMTP id e5ls1608478laa.105.gmail; Mon, 05 Jan 2015 06:55:26 -0800 (PST) X-Received: by 10.152.219.3 with SMTP id pk3mr93047108lac.19.1420469726372; Mon, 05 Jan 2015 06:55:26 -0800 (PST) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id z4si59408432lae.103.2015.01.05.06.55.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Jan 2015 06:55:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id pv20so18406667lab.13 for ; Mon, 05 Jan 2015 06:55:26 -0800 (PST) X-Received: by 10.112.104.4 with SMTP id ga4mr23063580lbb.24.1420469726298; Mon, 05 Jan 2015 06:55:26 -0800 (PST) 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.112.9.200 with SMTP id c8csp903939lbb; Mon, 5 Jan 2015 06:55:25 -0800 (PST) X-Received: by 10.112.27.133 with SMTP id t5mr92965258lbg.45.1420469719456; Mon, 05 Jan 2015 06:55:19 -0800 (PST) Received: from mail-we0-f179.google.com (mail-we0-f179.google.com. [74.125.82.179]) by mx.google.com with ESMTPS id bg10si17113360wib.33.2015.01.05.06.55.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Jan 2015 06:55:19 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.179 as permitted sender) client-ip=74.125.82.179; Received: by mail-we0-f179.google.com with SMTP id q59so7922651wes.24 for ; Mon, 05 Jan 2015 06:55:19 -0800 (PST) X-Received: by 10.180.75.42 with SMTP id z10mr26549626wiv.70.1420469717705; Mon, 05 Jan 2015 06:55:17 -0800 (PST) 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 n5sm10239010wic.6.2015.01.05.06.55.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jan 2015 06:55:16 -0800 (PST) From: Daniel Thompson To: Thomas Gleixner , Jason Cooper Cc: Daniel Thompson , Russell King , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal , Dirk Behme , Daniel Drake , Dmitry Pervushin , Tim Sander , Stephen Boyd , Steven Rostedt Subject: [PATCH 3.19-rc2 v13 5/5] ARM: Fix on-demand backtrace triggered by IRQ Date: Mon, 5 Jan 2015 14:54:59 +0000 Message-Id: <1420469699-25350-6-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1420469699-25350-1-git-send-email-daniel.thompson@linaro.org> References: <1415968543-29469-1-git-send-email-daniel.thompson@linaro.org> <1420469699-25350-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.215.54 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: , Currently if arch_trigger_all_cpu_backtrace() is called with interrupts disabled and on a platform the delivers IPI_CPU_BACKTRACE using regular IRQ requests the system will wedge for ten seconds waiting for the current CPU to react to a masked interrupt. This patch resolves this issue by calling directly into the backtrace dump code instead of generating an IPI. Signed-off-by: Daniel Thompson Cc: Steven Rostedt --- arch/arm/kernel/smp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 12667eb68198..644f654f7a7e 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -767,7 +767,10 @@ void ipi_cpu_backtrace(struct pt_regs *regs) /* Replace printk to write into the NMI seq */ this_cpu_write(printk_func, nmi_vprintk); printk(KERN_WARNING "NMI backtrace for cpu %d\n", cpu); - show_regs(regs); + if (regs != NULL) + show_regs(regs); + else + dump_stack(); this_cpu_write(printk_func, printk_func_save); cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask)); @@ -812,6 +815,16 @@ void arch_trigger_all_cpu_backtrace(bool include_self) seq_buf_init(&s->seq, s->buffer, NMI_BUF_SIZE); } + /* + * If irqs are disabled on the current processor then, if + * IPI_CPU_BACKTRACE is delivered using IRQ, we will won't be able to + * react to IPI_CPU_BACKTRACE until we leave this function. We avoid + * the potential timeout (not to mention the failure to print useful + * information) by calling the backtrace directly. + */ + if (include_self && irqs_disabled()) + ipi_cpu_backtrace(in_interrupt() ? get_irq_regs() : NULL); + if (!cpumask_empty(to_cpumask(backtrace_mask))) { pr_info("Sending NMI to %s CPUs:\n", (include_self ? "all" : "other"));