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: 5694461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 97E06C058D for ; Fri, 23 Jan 2015 14:31:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBE8F202B8 for ; Fri, 23 Jan 2015 14:31:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 258D9202E6 for ; Fri, 23 Jan 2015 14:31:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEfEC-0006qM-5p; Fri, 23 Jan 2015 14:28:52 +0000 Received: from mail-wg0-f44.google.com ([74.125.82.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEfAB-0002sH-JT for linux-arm-kernel@lists.infradead.org; Fri, 23 Jan 2015 14:24:44 +0000 Received: by mail-wg0-f44.google.com with SMTP id z12so7776979wgg.3 for ; Fri, 23 Jan 2015 06:24:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6YIAQsaeu6MpZhlSMaRzmZvQtoTz2vjou6/zh+AS6ps=; b=iA2muXv7wk5sm/QtnH74m4f3DQR65uxcXtpwB0JZtHnfZr8HS/bD/U7lgKGX3RE524 osnVJiDagyLGE0ju0wcj0rM72mJlwOm6xsN0N8Z8oNPoxpLapISDMsuPwqpnC1dhV5kq +WbfzgXoK5tBudGj8uBGc7+IeCazZY7BJ1rPi157ugI824fbDzqVXOGTrO4UZhfhOmcn awQwUX9bnp6Tdh8fGeInXSdTOH90zpo8jzkq6bH7PcKMtyBdXg5VljhD8hfSgluSlibd fSF8MgsMZQ3/yNbaKFLXrMeCGqWIDxKbMOC5YeC6khlRK1CIBRhAIA6og96dzFP881lz J46w== X-Gm-Message-State: ALoCoQnH14She3RR27gSW2d7FPxWya8Un5gmfaeGuEHb2ewpRNjdxQX9uzPK+i6n8lfky/Sa2q6H 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150123_062443_861083_EC9CFA13 X-CRM114-Status: GOOD ( 11.61 ) X-Spam-Score: -0.7 (/) Cc: Daniel Thompson , linaro-kernel@lists.linaro.org, Russell King , Jason Cooper , patches@linaro.org, Marc Zyngier , Catalin Marinas , Will Deacon , linux-kernel@vger.kernel.org, Steven Rostedt , Sumit Semwal , Dmitry Pervushin , Dirk Behme , John Stultz , Tim Sander , Daniel Drake , Stephen Boyd , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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));