From patchwork Tue Jan 13 10:26:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 42988 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11E0220DE8 for ; Tue, 13 Jan 2015 10:27:44 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id y19sf1206553wgg.1 for ; Tue, 13 Jan 2015 02:27:43 -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=ERCLOb937LeeOkBZqABP+QDqtu1l4G8/0IQZr/8XodA=; b=fOI4nzvWKqdacDv/Lm+DvkBcAL4mhNewWCkobguoamiJmh9IVJzYF9gusDk4aSunqY ij4T67GnzshkI7TY5RAeYbyguE/sPAtni1LGv8DjtNW+2fO/8Nv6okzJFJn/351XR6Gf yxJm056MAZYTLC8GxDiJ8X+qFbYM4cbVUlD7O3/sjB9XvTlVIf7gSpcswzACSJLj1aHE eRnVYezfH2/oPkT3FL6R1kE2F5X2rF/N2zX9zR8NdDq+L0vyjpXiPCGxNvxfnrdFuR8C 2zfToo4Wb+JQlHfpy06XmZ+EnR1LgYUPjDKnldUh1VTL99nkWcTuxRZmV3QCP6d5syiw 4GMg== X-Gm-Message-State: ALoCoQms2eo8/f6fQVb2R4ArtOyYwgu6AWAkItWpQze/yyqNS93HcmlTd6iwPp2HtZIWbJQT7faZ X-Received: by 10.194.176.200 with SMTP id ck8mr239985wjc.0.1421144863326; Tue, 13 Jan 2015 02:27:43 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.234 with SMTP id r10ls614053lal.17.gmail; Tue, 13 Jan 2015 02:27:43 -0800 (PST) X-Received: by 10.112.169.34 with SMTP id ab2mr41416684lbc.77.1421144863175; Tue, 13 Jan 2015 02:27:43 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id xr6si23895694lbb.1.2015.01.13.02.27.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 02:27:43 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id l4so1771357lbv.11 for ; Tue, 13 Jan 2015 02:27:43 -0800 (PST) X-Received: by 10.152.115.146 with SMTP id jo18mr42006235lab.9.1421144863099; Tue, 13 Jan 2015 02:27:43 -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 c8csp1337910lbb; Tue, 13 Jan 2015 02:27:42 -0800 (PST) X-Received: by 10.194.175.2 with SMTP id bw2mr35094045wjc.117.1421144858007; Tue, 13 Jan 2015 02:27:38 -0800 (PST) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com. [209.85.212.182]) by mx.google.com with ESMTPS id cv8si40934561wjc.78.2015.01.13.02.27.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 02:27:37 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.182 as permitted sender) client-ip=209.85.212.182; Received: by mail-wi0-f182.google.com with SMTP id h11so2791344wiw.3 for ; Tue, 13 Jan 2015 02:27:37 -0800 (PST) X-Received: by 10.194.89.3 with SMTP id bk3mr10794322wjb.92.1421144857724; Tue, 13 Jan 2015 02:27:37 -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 u18sm25111297wjq.42.2015.01.13.02.27.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 02:27:36 -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 v14 7/7] ARM: Fix on-demand backtrace triggered by IRQ Date: Tue, 13 Jan 2015 10:26:58 +0000 Message-Id: <1421144818-14036-8-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421144818-14036-1-git-send-email-daniel.thompson@linaro.org> References: <1415968543-29469-1-git-send-email-daniel.thompson@linaro.org> <1421144818-14036-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.180 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 afb094a1e6d4..cf3b738568b8 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -742,6 +742,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")); @@ -770,7 +780,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));