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: 35628 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D60AE202DD for ; Tue, 19 Aug 2014 16:46:42 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g18sf44675437oah.2 for ; Tue, 19 Aug 2014 09:46:42 -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=NtAK8ee2NZ+Egd87Ctu/l49MwdcjN8Il06KgihpDG8U=; b=YdsTJCnH3hdhCs7WFGonbqzY55umbrm25zAmyETX56W1xx6rdz6h9uowdCEVLQqeWe mqfZLHtbtY3yJMj6N30iH3Qo4LDVoNHml5zOVS6W3A0vr5zs/5VpETMNZBUkIX3e97h8 zq8BmhZn5NyanYlJw2xCeyo3j5Hh8JnRK9DgTX8NXJslH3kvD+i3+4u/A22dkxqv/Ql5 yPdbxaW1Gpkg8pALmWy/+yRPe1aydyII8PAjW8Tmx1TPOWQ2RgotuWiaYinY4YgMOa9P Kb0Hb+a17BnIQkJKYwr77ITuzTHtEDoRkoXtV9hq0vMPGo6hcbyCpPrgx7rqdCcA9eBZ BEaw== X-Gm-Message-State: ALoCoQmEEMGDXRMOoNJbVVATFuUmwxFS9Fdxs7ElE3r0DT9B8ur++K++Qa5MFqGiiKxktErsH9OO X-Received: by 10.182.125.68 with SMTP id mo4mr538465obb.49.1408466802503; Tue, 19 Aug 2014 09:46:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.47 with SMTP id w44ls2831364qgd.56.gmail; Tue, 19 Aug 2014 09:46:42 -0700 (PDT) X-Received: by 10.220.202.9 with SMTP id fc9mr2041856vcb.40.1408466802355; Tue, 19 Aug 2014 09:46:42 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id xk9si9117534vdc.48.2014.08.19.09.46.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 09:46:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id la4so7744074vcb.37 for ; Tue, 19 Aug 2014 09:46:42 -0700 (PDT) X-Received: by 10.52.119.229 with SMTP id kx5mr2284176vdb.40.1408466802280; Tue, 19 Aug 2014 09:46:42 -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.37.5 with SMTP id tc5csp254336vcb; Tue, 19 Aug 2014 09:46:41 -0700 (PDT) X-Received: by 10.194.110.135 with SMTP id ia7mr4163626wjb.128.1408466801187; Tue, 19 Aug 2014 09:46:41 -0700 (PDT) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx.google.com with ESMTPS id s7si23280035wib.69.2014.08.19.09.46.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 09:46:41 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by mail-wi0-f174.google.com with SMTP id d1so5748754wiv.7 for ; Tue, 19 Aug 2014 09:46:40 -0700 (PDT) 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 Cc: Daniel Thompson , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgdb-bugreport@lists.sourceforge.net, patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Anton Vorontsov , Colin Cross , kernel-team@android.com, Rob Herring , Linus Walleij , Ben Dooks , Catalin Marinas , Dave Martin , Fabio Estevam , Frederic Weisbecker , Nicolas Pitre 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-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.178 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: , 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);