From patchwork Tue Aug 19 16:45:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 4744561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA00A9F375 for ; Tue, 19 Aug 2014 16:49:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EA3602015A for ; Tue, 19 Aug 2014 16:49:57 +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 1D19820103 for ; Tue, 19 Aug 2014 16:49: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 1XJmZH-0005ao-Gg; Tue, 19 Aug 2014 16:47:31 +0000 Received: from mail-wg0-f51.google.com ([74.125.82.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XJmYp-0005AO-4j for linux-arm-kernel@lists.infradead.org; Tue, 19 Aug 2014 16:47:03 +0000 Received: by mail-wg0-f51.google.com with SMTP id b13so6648175wgh.10 for ; Tue, 19 Aug 2014 09:46:40 -0700 (PDT) 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=NtAK8ee2NZ+Egd87Ctu/l49MwdcjN8Il06KgihpDG8U=; b=d/79KeOwuAAUFWkG+WV1wPFAK/3uKz0Y/+fBPDp9EnTqt6kpyJJ7BKwoDPeTgfRfS/ E5qCg+01g1RnqcWYXixYPoTCgzC8m4Vu0yrZHub88HtDIlnXkbQ+8g/FeR60Nx8v+4bz xMJeLfQrMBmGYmZSf9i4+B4U4AA34d3+otRTIFc7ITaZcqw4DQTWG1kTnt8/RRsXb2Xk IHp3WqrXNkFMh/IOXWghhGLIQPizuniTAc77d7bowVgfab2NQf0nihhvc79+P8/5hjcl 9ODe18RF8tdWI+Fwrwwqke8gWTgNHW6K/UtzlDvEt2WjacSifgmqR3BESCo3O8GCemVD FHjg== X-Gm-Message-State: ALoCoQmV/ILzgvUJBVmfscYfYcEN7lN3xQVgpznfKBacb6AwKjzAgE67Zm8qLgdgGDOSOUP2xsx8 X-Received: by 10.194.61.99 with SMTP id o3mr18423046wjr.103.1408466800613; Tue, 19 Aug 2014 09:46:40 -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 gc8sm36225wic.3.2014.08.19.09.46.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Aug 2014 09:46:39 -0700 (PDT) From: Daniel Thompson To: Russell King Subject: [PATCH v10 04/19] arm: smp: Introduce a special IPI signalled using FIQ Date: Tue, 19 Aug 2014 17:45:54 +0100 Message-Id: <1408466769-20004-5-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408466769-20004-1-git-send-email-daniel.thompson@linaro.org> References: <1408369264-14242-1-git-send-email-daniel.thompson@linaro.org> <1408466769-20004-1-git-send-email-daniel.thompson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140819_094703_348265_C92A2246 X-CRM114-Status: GOOD ( 15.27 ) X-Spam-Score: -0.7 (/) Cc: Daniel Thompson , linaro-kernel@lists.linaro.org, Catalin Marinas , patches@linaro.org, kgdb-bugreport@lists.sourceforge.net, Linus Walleij , Nicolas Pitre , linux-kernel@vger.kernel.org, Frederic Weisbecker , Anton Vorontsov , Ben Dooks , John Stultz , Fabio Estevam , Colin Cross , kernel-team@android.com, Dave Martin , 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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 Cross CPU signalling based on FIQ is especially useful for kgdb since it makes stopping all the CPUs during breakpointing more robust (some of the other architectures already roundup the CPUs using NMIs). The approach taken provides infrastructure that can be called (or not) by the driver's FIQ handler depending upon it requirements. In other words nothing is added here that prevents the driver from accessing "bare metal" performance. Signed-off-by: Daniel Thompson --- arch/arm/include/asm/hardirq.h | 2 +- arch/arm/include/asm/smp.h | 7 +++++++ arch/arm/kernel/smp.c | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index fe3ea77..5df33e3 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -5,7 +5,7 @@ #include #include -#define NR_IPI 8 +#define NR_IPI 9 typedef struct { unsigned int __softirq_pending; diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 2ec765c..215c927 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h @@ -20,6 +20,9 @@ #define raw_smp_processor_id() (current_thread_info()->cpu) +/* bitmap of IPIs that must be signalled using FIQ */ +#define SMP_IPI_FIQ_MASK 0x0100 + struct seq_file; /* @@ -87,6 +90,10 @@ extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); extern int register_ipi_completion(struct completion *completion, int cpu); +#ifdef CONFIG_FIQ +extern void send_fiq_ipi_mask(const struct cpumask *); +#endif + struct smp_operations { #ifdef CONFIG_SMP /* diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 9388a3d..d386c32 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -72,6 +72,7 @@ enum ipi_msg_type { IPI_CPU_STOP, IPI_IRQ_WORK, IPI_COMPLETION, + IPI_FIQ, }; static DECLARE_COMPLETION(cpu_running); @@ -451,6 +452,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_FIQ, "FIQ interrupts"), }; static void smp_cross_call(const struct cpumask *target, unsigned int ipinr) @@ -552,6 +554,13 @@ static void ipi_complete(unsigned int cpu) complete(per_cpu(cpu_completion, cpu)); } +#ifdef CONFIG_FIQ +void send_fiq_ipi_mask(const struct cpumask *mask) +{ + smp_cross_call(mask, IPI_FIQ); +} +#endif + /* * Main handler for inter-processor interrupts */ @@ -618,6 +627,12 @@ void handle_IPI(int ipinr, struct pt_regs *regs) irq_exit(); break; +#ifdef CONFIG_FIQ + case IPI_FIQ: + pr_crit("CPU%u: IPI FIQ delivered via IRQ vector\n", cpu); + break; +#endif + default: printk(KERN_CRIT "CPU%u: Unknown IPI message 0x%x\n", cpu, ipinr);