From patchwork Fri Jan 23 14:22:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 43646 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D5F2218DB for ; Fri, 23 Jan 2015 14:24:26 +0000 (UTC) Received: by mail-we0-f200.google.com with SMTP id m14sf4384738wev.3 for ; Fri, 23 Jan 2015 06:24:25 -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=6YIAQsaeu6MpZhlSMaRzmZvQtoTz2vjou6/zh+AS6ps=; b=Grh1WJ/2iRuEVMxX3FZHG/N5ZUEEna6YAR2IUTRcD1+CY+Xx+8ZqMdfh5MAda/aClg /cSuVhovzs+1EgeFA3p8GckQH/CGTk4A48a9aPwOT360tb8DuvGIhf8n1k1UVt/BiQRp ej77wb5eS8efPjJewzwrx0gepZu7jEmaNZcuSFuDGV1z+VF+pIdKRequSPARrTtk0UTB j/OoypZYgl+396Q3ws6lGlmII15YHwYkkGM++/QWdcBhaMnwPD//VOOWLqjFx9rkqGtL BvCkW6jSBuwI0DDteX2iUjjLs7C3cJclhXg0T7D+YvvATsCB0w5IVDvPLrBOECY+nu/P b/dg== X-Gm-Message-State: ALoCoQnkqYDKG39h72ilfabgN2jvkB66k0IsDCRj73vH3s/04G+VpirZoQYOwOzNhEXEotbZxG+K X-Received: by 10.180.37.107 with SMTP id x11mr328864wij.5.1422023065597; Fri, 23 Jan 2015 06:24:25 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.97 with SMTP id z1ls293409laz.35.gmail; Fri, 23 Jan 2015 06:24:25 -0800 (PST) X-Received: by 10.112.38.4 with SMTP id c4mr7681832lbk.46.1422023065432; Fri, 23 Jan 2015 06:24:25 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id do2si1518745lac.33.2015.01.23.06.24.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 06:24:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id u14so7266271lbd.2 for ; Fri, 23 Jan 2015 06:24:25 -0800 (PST) X-Received: by 10.112.64.35 with SMTP id l3mr7522789lbs.82.1422023065351; Fri, 23 Jan 2015 06:24:25 -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 c8csp270881lbb; Fri, 23 Jan 2015 06:24:24 -0800 (PST) X-Received: by 10.180.39.35 with SMTP id m3mr4208941wik.3.1422023061397; Fri, 23 Jan 2015 06:24:21 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com. [209.85.212.177]) by mx.google.com with ESMTPS id ee1si3332524wjd.89.2015.01.23.06.24.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 06:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.177 as permitted sender) client-ip=209.85.212.177; Received: by mail-wi0-f177.google.com with SMTP id r20so3144123wiv.4 for ; Fri, 23 Jan 2015 06:24:21 -0800 (PST) X-Received: by 10.180.94.163 with SMTP id dd3mr244174wib.82.1422023059677; Fri, 23 Jan 2015 06:24:19 -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 bj3sm2058188wib.3.2015.01.23.06.24.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 06:24:19 -0800 (PST) From: Daniel Thompson To: Thomas Gleixner Cc: Daniel Thompson , Jason Cooper , Russell King , Will Deacon , Catalin Marinas , Marc Zyngier , Stephen Boyd , John Stultz , Steven Rostedt , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, Sumit Semwal , Dirk Behme , Daniel Drake , Dmitry Pervushin , Tim Sander Subject: [PATCH 3.19-rc2 v15 8/8] ARM: Fix on-demand backtrace triggered by IRQ Date: Fri, 23 Jan 2015 14:22:32 +0000 Message-Id: <1422022952-31552-9-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422022952-31552-1-git-send-email-daniel.thompson@linaro.org> References: <1422022952-31552-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.217.171 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 Cc: Russell King --- 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 93fe51d305d1..ef35cf832aee 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -739,6 +739,16 @@ void arch_trigger_all_cpu_backtrace(bool include_self) cpumask_clear_cpu(this_cpu, to_cpumask(backtrace_mask)); cpumask_copy(&printtrace_mask, to_cpumask(backtrace_mask)); + /* + * 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 FIQ to %s CPUs:\n", (include_self ? "all" : "other")); @@ -767,7 +777,10 @@ void ipi_cpu_backtrace(struct pt_regs *regs) if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) { orig = this_cpu_begin_nmi_printk(); pr_warn("FIQ backtrace for cpu %d\n", cpu); - show_regs(regs); + if (regs != NULL) + show_regs(regs); + else + dump_stack(); this_cpu_end_nmi_printk(orig); cpumask_clear_cpu(cpu, to_cpumask(backtrace_mask));