From patchwork Wed Sep 17 16:10:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37532 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C15C92057E for ; Wed, 17 Sep 2014 16:10:33 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id z11sf995938lbi.6 for ; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) 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=9tC8tvG7ca6ffCBOwY/8TEbqxKW5mv9noX3sayeZ6KQ=; b=MVv9gozeBy1Y417akUM/QVn9UmHzgbxAHPzaomiDLv7RBPVI+yA0yDE6RnxXhs4IYe AHEefNhDMCd/AmYGA8T0J/K8f2JiDwXQy12hB0JTkJlIskgyIM7SnQvelddBHBiC48rk yCVdAxpLyWewVK3GqH/w2dyTTe8I8TSymBMsZzvjAnjaRn/ZrGs9la8oYoHQFyYzDwE3 Ld2tFX96dFnExTk43hx3G259q8nqfoQk0ssVgLbO72wvlNXZo7s9OD/6FDtflaW9qTTc WwhL8X06gzM+ekbgiajjhePIgezrtUoV50dVmcdJx9DdtLiYXVFRAdv/EAAq/3PpjW5R Zevg== X-Gm-Message-State: ALoCoQlPxDXoUcFZ7pS2ApTxbk739tEVSFVY+HVdFNgyxYjndVCiRIGA+ULqPdJu7f/fznyIwz4X X-Received: by 10.112.155.133 with SMTP id vw5mr112692lbb.14.1410970232599; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.4 with SMTP id lk4ls133691lac.41.gmail; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) X-Received: by 10.152.10.203 with SMTP id k11mr45667744lab.30.1410970232486; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id h4si16419095lbd.53.2014.09.17.09.10.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 09:10:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id b17so2178477lan.18 for ; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) X-Received: by 10.112.53.230 with SMTP id e6mr4019972lbp.100.1410970232418; Wed, 17 Sep 2014 09:10:32 -0700 (PDT) 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.130.169 with SMTP id of9csp608009lbb; Wed, 17 Sep 2014 09:10:31 -0700 (PDT) X-Received: by 10.69.18.202 with SMTP id go10mr12219588pbd.84.1410970230017; Wed, 17 Sep 2014 09:10:30 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id sk4si35528344pab.163.2014.09.17.09.10.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 09:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.220.52 as permitted sender) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq14so2402873pab.11 for ; Wed, 17 Sep 2014 09:10:29 -0700 (PDT) X-Received: by 10.66.66.229 with SMTP id i5mr26433667pat.131.1410970229325; Wed, 17 Sep 2014 09:10:29 -0700 (PDT) Received: from harvey.bri.st.com ([38.126.120.10]) by mx.google.com with ESMTPSA id pd7sm17841758pac.33.2014.09.17.09.10.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Sep 2014 09:10:28 -0700 (PDT) From: Daniel Thompson To: Russell King Cc: Daniel Thompson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Thomas Gleixner , Sumit Semwal Subject: [PATCH 3.17-rc4 v7 6/6] arm: smp: Handle ipi_cpu_backtrace() using FIQ (if available) Date: Wed, 17 Sep 2014 09:10:18 -0700 Message-Id: <1410970218-28847-7-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410970218-28847-1-git-send-email-daniel.thompson@linaro.org> References: <1410970218-28847-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.45 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 a replacement default FIQ handler and an implementation of arch_trigger_all_cpu_backtrace for ARM but these are currently independant. 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 2ec765c..0580270 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; @@ -85,6 +87,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 94959f9..7a79d11 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -543,7 +543,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(); @@ -584,6 +584,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 92c4ea1..40b1de7 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();