From patchwork Tue Apr 9 20:03:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 2416821 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 48B293FD8C for ; Tue, 9 Apr 2013 20:04:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPelp-0008Rm-UG; Tue, 09 Apr 2013 20:03:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPeln-0003EM-ER; Tue, 09 Apr 2013 20:03:55 +0000 Received: from mail-qc0-x233.google.com ([2607:f8b0:400d:c01::233]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UPelk-0003E1-JN for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2013 20:03:53 +0000 Received: by mail-qc0-f179.google.com with SMTP id v28so3156804qcm.24 for ; Tue, 09 Apr 2013 13:03:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type:x-gm-message-state; bh=PqOecwh02xfhXVEuVRZKCn8/g+58Y4ZcLBCD4exN2pA=; b=BhVhtG/b9fXWbv6q9XHM6GmPv0iKto84g0KlpIyHhGwhBVve/soPS8Tsfhcf3qe8ba AyVc90OdTZIFJWficL0heXllolh6FyUniJzArPzbP16CE2zkU//NKbAyfFv2JRlcgXFN PlflG1DlEtYXsO+RY8sNFiG6zGvGBAkG/qY8hgb4bUyRt9QloRHy4fBJwTBQue6UeaK6 M/BzkbFbt5bCmFzVtKnQ5BsNVTtXCLK+4mldVeZ5xWRu/Rfg6oKa6weTxeJ1mGTJfHg+ 9t6uJQnqZouObxdgFiMAH4Gt0mqdLrQDavaIrL/xcyKMCt4fw+L5UEfXCdDT3bvdnCBq X6MA== X-Received: by 10.229.197.193 with SMTP id el1mr266357qcb.86.1365537827770; Tue, 09 Apr 2013 13:03:47 -0700 (PDT) Received: from xanadu.home (modemcable139.65-203-24.mc.videotron.ca. [24.203.65.139]) by mx.google.com with ESMTPS id c2sm27283805qeg.6.2013.04.09.13.03.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 09 Apr 2013 13:03:47 -0700 (PDT) Date: Tue, 9 Apr 2013 16:03:45 -0400 (EDT) From: Nicolas Pitre To: Stefano Stabellini Subject: Re: [PATCH v6 3/4] ARM: Enable selection of SMP operations at boot time In-Reply-To: <1365167495-18508-3-git-send-email-stefano.stabellini@eu.citrix.com> Message-ID: References: <1365167495-18508-3-git-send-email-stefano.stabellini@eu.citrix.com> User-Agent: Alpine 2.03 (LFD 1266 2009-07-14) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlzIUqrcbQ/S+30whYnjBNK4/rCe5BObIGps75SI+IEEzPuJeJfQ6D/BbWxuST33TB++HWU X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130409_160352_709721_47BAE1B9 X-CRM114-Status: GOOD ( 17.34 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jon Medhurst , xen-devel@lists.xensource.com, Arnd Bergmann , Will Deacon , linux-kernel@vger.kernel.org, rob.herring@calxeda.com, 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Fri, 5 Apr 2013, Stefano Stabellini wrote: > From: Jon Medhurst > > Add a new 'smp_init' hook to machine_desc so platforms can specify a > function to be used to setup smp ops instead of having a statically > defined value. > > If smp_init is set, use it instead of psci_smp_ops or mdesc->smp. > > Signed-off-by: Jon Medhurst > Signed-off-by: Nicolas Pitre > Signed-off-by: Stefano Stabellini > Reviewed-by: Santosh Shilimkar > --- > arch/arm/include/asm/mach/arch.h | 3 +++ > arch/arm/kernel/setup.c | 4 +++- > 2 files changed, 6 insertions(+), 1 deletions(-) Please use this version instead. The runtime hook may now indicate if it did initialize smp_ops or not. ----- >8 From: Jon Medhurst Date: Thu, 13 Dec 2012 13:23:13 +0000 Subject: [PATCH] ARM: Enable selection of SMP operations at boot time Add a new 'smp_init' hook to machine_desc so platforms can specify a function to be used to setup smp ops instead of having a statically defined value. The hook must return true when smp_ops are initialized. If false the static mdesc->smp_ops will be used by default. Signed-off-by: Jon Medhurst Signed-off-by: Nicolas Pitre Reviewed-by: Santosh Shilimkar diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h index 308ad7d6f9..af8c54c6c6 100644 --- a/arch/arm/include/asm/mach/arch.h +++ b/arch/arm/include/asm/mach/arch.h @@ -16,8 +16,10 @@ struct pt_regs; struct smp_operations; #ifdef CONFIG_SMP #define smp_ops(ops) (&(ops)) +#define smp_init_ops(ops) (&(ops)) #else #define smp_ops(ops) (struct smp_operations *)NULL +#define smp_init_ops(ops) (bool (*)(void))NULL #endif struct machine_desc { @@ -41,6 +43,7 @@ struct machine_desc { unsigned char reserve_lp2 :1; /* never has lp2 */ char restart_mode; /* default restart mode */ struct smp_operations *smp; /* SMP operations */ + bool (*smp_init)(void); void (*fixup)(struct tag *, char **, struct meminfo *); void (*reserve)(void);/* reserve mem blocks */ diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 3f6cbb2e3e..cf4b08c0f9 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -768,7 +768,8 @@ void __init setup_arch(char **cmdline_p) arm_dt_init_cpu_maps(); #ifdef CONFIG_SMP if (is_smp()) { - smp_set_ops(mdesc->smp); + if (!mdesc->smp_init || !mdesc->smp_init()) + smp_set_ops(mdesc->smp); smp_init_cpus(); } #endif