linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Will Deacon <will.deacon@arm.com>, Arnd Bergmann <arnd@arndb.de>,
	rob.herring@calxeda.com, Jon Medhurst <tixy@linaro.org>
Subject: Re: [PATCH v6 3/4] ARM: Enable selection of SMP operations at boot time
Date: Tue, 9 Apr 2013 16:03:45 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.03.1304091600330.17375@syhkavp.arg> (raw)
In-Reply-To: <1365167495-18508-3-git-send-email-stefano.stabellini@eu.citrix.com>

On Fri, 5 Apr 2013, Stefano Stabellini wrote:

> From: Jon Medhurst <tixy@linaro.org>
> 
> 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 <tixy@linaro.org>
> Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  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 <tixy@linaro.org>
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 <tixy@linaro.org>
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

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

  reply	other threads:[~2013-04-09 20:03 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05 13:10 [PATCH 0/4 v6] arm: introduce psci_smp_ops and use them on Xen Stefano Stabellini
2013-04-05 13:11 ` [PATCH v6 1/4] arm: introduce psci_smp_ops Stefano Stabellini
2013-04-18 16:13   ` Russell King - ARM Linux
2013-04-18 16:20     ` Stefano Stabellini
2013-04-18 16:35       ` Nicolas Pitre
2013-04-18 16:49         ` Stefano Stabellini
2013-04-18 17:40           ` Nicolas Pitre
2013-04-22 14:23           ` Russell King - ARM Linux
2013-04-22 14:20         ` Russell King - ARM Linux
2013-04-18 16:40       ` Nicolas Pitre
2013-04-18 17:01         ` Stefano Stabellini
2013-04-18 17:38           ` Nicolas Pitre
2013-04-19  9:40             ` Stefano Stabellini
2013-04-19 15:47               ` Nicolas Pitre
2013-04-19 16:16                 ` [Xen-devel] " Ian Campbell
2013-04-19 16:33                   ` Nicolas Pitre
2013-04-19 17:06                     ` Stefano Stabellini
2013-04-22 15:21                       ` Ian Campbell
2013-04-22 16:07                         ` Nicolas Pitre
2013-04-24 18:13                           ` Stefano Stabellini
2013-04-25  7:48                           ` Ian Campbell
2013-04-19  9:52             ` Ian Campbell
2013-04-22 14:06       ` Russell King - ARM Linux
2013-04-24 18:25         ` Stefano Stabellini
2013-04-05 13:11 ` [PATCH v6 2/4] arm: prefer psci_smp_ops over mdesc->smp Stefano Stabellini
2013-04-05 16:15   ` Nicolas Pitre
2013-04-05 13:11 ` [PATCH v6 3/4] ARM: Enable selection of SMP operations at boot time Stefano Stabellini
2013-04-09 20:03   ` Nicolas Pitre [this message]
2013-04-05 13:11 ` [PATCH v6 4/4] xen/arm: introduce xen_early_init, use PSCI on xen Stefano Stabellini
2013-04-05 16:22   ` Nicolas Pitre
2013-04-05 17:16     ` Stefano Stabellini
2013-04-05 17:34       ` Stefano Stabellini
2013-04-05 19:41         ` Nicolas Pitre
2013-04-05 19:36       ` Nicolas Pitre
2013-04-05 20:50         ` Rob Herring
2013-04-05 21:21           ` Nicolas Pitre
2013-04-05 23:20             ` Stefano Stabellini
2013-04-06  0:15               ` Nicolas Pitre
2013-04-05 23:15           ` Stefano Stabellini
2013-04-05 16:01 ` [PATCH 0/4 v6] arm: introduce psci_smp_ops and use them on Xen Stefano Stabellini
2013-04-08 11:05 ` Stefano Stabellini
2013-04-11  8:25   ` Olof Johansson
2013-04-11 20:16     ` Rob Herring
2013-04-12  8:57       ` Will Deacon
2013-04-12 10:58         ` Stefano Stabellini
2013-04-12 14:13         ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.03.1304091600330.17375@syhkavp.arg \
    --to=nicolas.pitre@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tixy@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).