From patchwork Tue Sep 9 14:15:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37115 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D31020566 for ; Tue, 9 Sep 2014 14:15:36 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id f51sf14958173qge.7 for ; Tue, 09 Sep 2014 07:15:35 -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=fnxy06CTA0Go18BcuLCjt8G9JDqj++Rvesv23Yi9A/c=; b=bQqv+szcAAenHCKfGEVQlFfV+yh/W1LM7SnoxTe9z1oVKwdPODvdo8+RMZwuCO40NL GG/vhqzlppvFpVV5TBvxQxAJgZvSyXbEOpl0wn6LP/jsilOckYQulDS1ysoJZJg6wb6d xNJ6URZD0KjbJSBsCeZILSRsbBpNBPaqiGhlufMHLVCCZhkrhIgwtEaLj4mgATrw+S2+ 5KyIncV9s8mf7OvfM0b4qCshAiX1ObWH+Dy+f4wo14AAnLEs+2YrgcEBwqOxmX8WxN/Q 1jRH6E4AdAy9BWQFInZB3du9RKA8OtLSRltodbqrfuJK9RIfHJC+XTMGXyqI6iAEv3On AgFA== X-Gm-Message-State: ALoCoQnO2NRbM65s1FZ+j+MJehGwBvbnRMmbdhJDU7Y/XG2f7/YF+P6bFwjiBx1w5VjkduNv0GUb X-Received: by 10.236.11.80 with SMTP id 56mr21832590yhw.22.1410272135788; Tue, 09 Sep 2014 07:15:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.225 with SMTP id w88ls1696356qge.38.gmail; Tue, 09 Sep 2014 07:15:35 -0700 (PDT) X-Received: by 10.52.1.227 with SMTP id 3mr468652vdp.90.1410272135597; Tue, 09 Sep 2014 07:15:35 -0700 (PDT) Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by mx.google.com with ESMTPS id v10si5834534vdt.16.2014.09.09.07.15.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 07:15:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.180 as permitted sender) client-ip=209.85.220.180; Received: by mail-vc0-f180.google.com with SMTP id lf12so17068426vcb.39 for ; Tue, 09 Sep 2014 07:15:35 -0700 (PDT) X-Received: by 10.52.3.40 with SMTP id 8mr25932905vdz.24.1410272135516; Tue, 09 Sep 2014 07:15:35 -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.221.45.67 with SMTP id uj3csp290833vcb; Tue, 9 Sep 2014 07:15:35 -0700 (PDT) X-Received: by 10.180.212.50 with SMTP id nh18mr29788078wic.81.1410272134404; Tue, 09 Sep 2014 07:15:34 -0700 (PDT) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id js1si17329996wjc.135.2014.09.09.07.15.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 07:15:34 -0700 (PDT) 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 em10so596295wid.16 for ; Tue, 09 Sep 2014 07:15:34 -0700 (PDT) X-Received: by 10.194.236.132 with SMTP id uu4mr4882431wjc.108.1410272134010; Tue, 09 Sep 2014 07:15:34 -0700 (PDT) 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 k10sm15059594wjb.28.2014.09.09.07.15.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Sep 2014 07:15:33 -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 v4 6/6] arm: smp: Handle ipi_cpu_backtrace() using FIQ (if available) Date: Tue, 9 Sep 2014 15:15:11 +0100 Message-Id: <1410272111-30516-7-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410272111-30516-1-git-send-email-daniel.thompson@linaro.org> References: <1410190115-32604-1-git-send-email-daniel.thompson@linaro.org> <1410272111-30516-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.220.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: , 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 | 5 ++++- arch/arm/kernel/traps.c | 3 +++ 3 files changed, 10 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..2a33bab 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -455,6 +455,7 @@ static const char *ipi_types[NR_IPI] __tracepoint_string = { S(IPI_CPU_STOP, "CPU stop interrupts"), S(IPI_IRQ_WORK, "IRQ work interrupts"), S(IPI_COMPLETION, "completion interrupts"), + S(IPI_BACKTRACE, "backtrace trigger interrupts"), }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) @@ -543,7 +544,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 +585,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();