From patchwork Fri May 9 00:48:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 4139791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DEAF7BFF02 for ; Fri, 9 May 2014 00:51:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D69B202EA for ; Fri, 9 May 2014 00:51:04 +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 4385F202EC for ; Fri, 9 May 2014 00:51:03 +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 1WiYzE-0004Im-NI; Fri, 09 May 2014 00:48:28 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiYz5-0004Fv-Uy; Fri, 09 May 2014 00:48:20 +0000 Received: from geoff by merlin.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1WiYz3-0007ir-Mt; Fri, 09 May 2014 00:48:17 +0000 Message-Id: <3bc3a27893963afadcbb63d5ad8e3ef84b9d74ac.1399594544.git.geoff@infradead.org> In-Reply-To: References: From: Geoff Levand Patch-Date: Wed, 7 May 2014 13:00:32 -0700 Subject: [PATCH 4/8] arm64: Add smp_spin_table_set_die To: Catalin Marinas , Will Deacon Date: Fri, 09 May 2014 00:48:17 +0000 Cc: Deepak Saxena , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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.5 required=5.0 tests=BAYES_00,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 Remove the const attribute from the smp_spin_table_ops instance in smp_spin_table.c and add the new routine smp_spin_table_set_die() which allows a custom cpu die method to be set in the smp_spin_table_ops instance. The ability to set a custom cpu die routine is needed by kexec to allow it to manage any secondary CPUs that need to be shut down as described in booting.txt. Signed-off-by: Geoff Levand --- arch/arm64/include/asm/cpu_ops.h | 2 ++ arch/arm64/kernel/smp_spin_table.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cpu_ops.h b/arch/arm64/include/asm/cpu_ops.h index 872f61a..42bcd24 100644 --- a/arch/arm64/include/asm/cpu_ops.h +++ b/arch/arm64/include/asm/cpu_ops.h @@ -63,4 +63,6 @@ extern int cpu_read_ops(struct device_node *dn, int cpu, const struct cpu_operations **cpu_ops); extern void __init cpu_read_bootcpu_ops(void); +void smp_spin_table_set_die(void (*fn)(unsigned int)); + #endif /* ifndef __ASM_CPU_OPS_H */ diff --git a/arch/arm64/kernel/smp_spin_table.c b/arch/arm64/kernel/smp_spin_table.c index 26c780b..ce7d0a3 100644 --- a/arch/arm64/kernel/smp_spin_table.c +++ b/arch/arm64/kernel/smp_spin_table.c @@ -153,7 +153,7 @@ static void smp_spin_table_cpu_die(unsigned int cpu) cpu_relax(); } -const struct cpu_operations smp_spin_table_ops = { +struct cpu_operations smp_spin_table_ops = { .name = "spin-table", .cpu_init = smp_spin_table_cpu_init, .cpu_prepare = smp_spin_table_cpu_prepare, @@ -162,3 +162,9 @@ const struct cpu_operations smp_spin_table_ops = { .cpu_disable = smp_spin_table_cpu_disable, .cpu_die = smp_spin_table_cpu_die, }; + +void smp_spin_table_set_die(void (*fn)(unsigned int)) +{ + BUG_ON(!fn); + smp_spin_table_ops.cpu_die = fn; +}