From patchwork Tue Nov 25 17:26:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 41501 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB92725E72 for ; Tue, 25 Nov 2014 17:27:49 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id s18sf730065lam.2 for ; Tue, 25 Nov 2014 09:27:48 -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=DgDi6pdiRE8xxlXMH2+tk85Fjj57DmPow/ZhalaO1mE=; b=D7GLtO/gdysBf6CjlTDUaDOAV/p7HsZlSNgxzrWyDwB8ULdSUzMXtx6F6SdBNRZ/Ys pH/kUTS12IrLNpmYsNeiAENLFUuceXFroxlRiguNzc+EYZXjq1UYbCtLFyRVQCzP0+cA tUNmqvCsJrc5q2aZeKfAD7XbFWLjQHxj1PhGG2qmDS8QEAov3VsJFFAo0w31YZ7BEpYL TXwLW51Fo1QVmL1oe6mFM31dG8TNps1uLzQCIbhkGBHW6Cufs63sNSHyDXtV5u/9oeSF Xz5UCO+rNcZHQxeSmW4wK04JAsY3VBGItWkeAhZOvau47NgujNQ5T3CHgh+lqgsICxAd 2BOQ== X-Gm-Message-State: ALoCoQljLkCkJhN2JhTJD0wprYM8FBHLfYV1KvF1AJuttKI1ZNzLXgucCm+baDgG1QuWJMX7gnTy X-Received: by 10.180.94.3 with SMTP id cy3mr5840802wib.7.1416936468663; Tue, 25 Nov 2014 09:27:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.226 with SMTP id b2ls563624lak.36.gmail; Tue, 25 Nov 2014 09:27:48 -0800 (PST) X-Received: by 10.152.234.163 with SMTP id uf3mr29099241lac.45.1416936468249; Tue, 25 Nov 2014 09:27:48 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id p3si1984006laj.83.2014.11.25.09.27.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 09:27:48 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id s18so991553lam.35 for ; Tue, 25 Nov 2014 09:27:48 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr28551483lbo.32.1416936468125; Tue, 25 Nov 2014 09:27:48 -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.184.201 with SMTP id ew9csp476387lbc; Tue, 25 Nov 2014 09:27:47 -0800 (PST) X-Received: by 10.180.221.72 with SMTP id qc8mr33787413wic.19.1416936464938; Tue, 25 Nov 2014 09:27:44 -0800 (PST) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com. [74.125.82.42]) by mx.google.com with ESMTPS id dr2si4111955wib.53.2014.11.25.09.27.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 09:27:44 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.42 as permitted sender) client-ip=74.125.82.42; Received: by mail-wg0-f42.google.com with SMTP id z12so1495682wgg.29 for ; Tue, 25 Nov 2014 09:27:44 -0800 (PST) X-Received: by 10.180.104.170 with SMTP id gf10mr26723318wib.43.1416936464728; Tue, 25 Nov 2014 09:27:44 -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 c5sm3696725wik.3.2014.11.25.09.27.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Nov 2014 09:27:43 -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 Subject: [PATCH 3.18-rc3 v9 5/5] arm: smp: Handle ipi_cpu_backtrace() using FIQ (if available) Date: Tue, 25 Nov 2014 17:26:41 +0000 Message-Id: <1416936401-5147-6-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1416936401-5147-1-git-send-email-daniel.thompson@linaro.org> References: <1415968543-29469-1-git-send-email-daniel.thompson@linaro.org> <1416936401-5147-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.48 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: , Previous changes have introduced both a replacement default FIQ handler and an implementation of arch_trigger_all_cpu_backtrace for ARM but these are currently independent of each other. This patch plumbs together these features making it possible, on platforms that support it, to trigger backtrace using FIQ. Signed-off-by: Daniel Thompson --- arch/arm/include/asm/smp.h | 3 +++ arch/arm/kernel/smp.c | 4 +++- arch/arm/kernel/traps.c | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 18f5a554134f..b076584ac0fa 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h @@ -18,6 +18,8 @@ # error " included in non-SMP build" #endif +#define SMP_IPI_FIQ_MASK 0x0100 + #define raw_smp_processor_id() (current_thread_info()->cpu) struct seq_file; @@ -79,6 +81,7 @@ extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); +extern void ipi_cpu_backtrace(struct pt_regs *regs); extern int register_ipi_completion(struct completion *completion, int cpu); struct smp_operations { diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 14c594a12bef..e923843562d9 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -539,7 +539,7 @@ static void ipi_cpu_stop(unsigned int cpu) cpu_relax(); } -static void ipi_cpu_backtrace(struct pt_regs *regs) +void ipi_cpu_backtrace(struct pt_regs *regs) { int cpu = smp_processor_id(); @@ -580,6 +580,8 @@ void handle_IPI(int ipinr, struct pt_regs *regs) unsigned int cpu = smp_processor_id(); struct pt_regs *old_regs = set_irq_regs(regs); + BUILD_BUG_ON(SMP_IPI_FIQ_MASK != BIT(IPI_CPU_BACKTRACE)); + if ((unsigned)ipinr < NR_IPI) { trace_ipi_entry(ipi_types[ipinr]); __inc_irq_stat(cpu, ipi_irqs[ipinr]); diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 4dc45b38e56e..9eb05be9526e 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -483,6 +483,9 @@ asmlinkage void __exception_irq_entry handle_fiq_as_nmi(struct pt_regs *regs) #ifdef CONFIG_ARM_GIC gic_handle_fiq_ipi(); #endif +#ifdef CONFIG_SMP + ipi_cpu_backtrace(regs); +#endif nmi_exit();