mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: arnd@arndb.de, olof@lixom.net, linux@arm.linux.org.uk
Cc: thomas.petazzoni@free-electrons.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] ARM: Make smp_init_cpus to return the number of cores
Date: Mon, 19 Jan 2015 17:53:00 +0100	[thread overview]
Message-ID: <1421686381-12397-2-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1421686381-12397-1-git-send-email-daniel.lezcano@linaro.org>

Return the number of cores the platform has.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/arm/include/asm/smp.h       | 2 +-
 arch/arm/mach-exynos/platsmp.c   | 6 ++++--
 arch/arm/mach-imx/platsmp.c      | 4 +++-
 arch/arm/mach-omap2/omap-smp.c   | 4 +++-
 arch/arm/mach-realview/platsmp.c | 4 +++-
 arch/arm/mach-socfpga/platsmp.c  | 4 +++-
 arch/arm/mach-spear/platsmp.c    | 4 +++-
 arch/arm/mach-ux500/platsmp.c    | 4 +++-
 arch/arm/mach-zynq/platsmp.c     | 4 +++-
 9 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 18f5a55..5ce30ee 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -86,7 +86,7 @@ struct smp_operations {
 	/*
 	 * Setup the set of possible CPUs (via set_cpu_possible)
 	 */
-	void (*smp_init_cpus)(void);
+	int (*smp_init_cpus)(void);
 	/*
 	 * Initialize cpu_possible map, and enable coherency
 	 */
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 7a1ebfe..686f42a 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -373,7 +373,7 @@ fail:
  * which may be present or become present in the system.
  */
 
-static void __init exynos_smp_init_cpus(void)
+static int __init exynos_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -385,7 +385,7 @@ static void __init exynos_smp_init_cpus(void)
 		 * CPU Nodes are passed thru DT and set_cpu_possible
 		 * is set by "arm_dt_init_cpu_maps".
 		 */
-		return;
+		return 0;
 
 	/* sanity check */
 	if (ncores > nr_cpu_ids) {
@@ -396,6 +396,8 @@ static void __init exynos_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init exynos_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 7f27001..70f0928 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -57,7 +57,7 @@ static int imx_boot_secondary(unsigned int cpu, struct task_struct *idle)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init imx_smp_init_cpus(void)
+static int __init imx_smp_init_cpus(void)
 {
 	int i, ncores;
 
@@ -65,6 +65,8 @@ static void __init imx_smp_init_cpus(void)
 
 	for (i = ncores; i < NR_CPUS; i++)
 		set_cpu_possible(i, false);
+
+	return ncores;
 }
 
 void imx_smp_prepare(void)
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index 5305ec7..4d31fea 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -175,7 +175,7 @@ static int omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init omap4_smp_init_cpus(void)
+static int __init omap4_smp_init_cpus(void)
 {
 	unsigned int i = 0, ncores = 1, cpu_id;
 
@@ -202,6 +202,8 @@ static void __init omap4_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 98e3052..0612f2d 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -42,7 +42,7 @@ static void __iomem *scu_base_addr(void)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init realview_smp_init_cpus(void)
+static int __init realview_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -58,6 +58,8 @@ static void __init realview_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init realview_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index c64d89b..45d4d87 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -58,7 +58,7 @@ static int socfpga_boot_secondary(unsigned int cpu, struct task_struct *idle)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init socfpga_smp_init_cpus(void)
+static int __init socfpga_smp_init_cpus(void)
 {
 	unsigned int i, ncores;
 
@@ -76,6 +76,8 @@ static void __init socfpga_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c
index fd42977..a6ef1ad 100644
--- a/arch/arm/mach-spear/platsmp.c
+++ b/arch/arm/mach-spear/platsmp.c
@@ -93,7 +93,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init spear13xx_smp_init_cpus(void)
+static int __init spear13xx_smp_init_cpus(void)
 {
 	unsigned int i, ncores = scu_get_core_count(scu_base);
 
@@ -105,6 +105,8 @@ static void __init spear13xx_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init spear13xx_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index a44967f..c8d8d4c 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -133,7 +133,7 @@ static void __init wakeup_secondary(void)
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init ux500_smp_init_cpus(void)
+static int __init ux500_smp_init_cpus(void)
 {
 	void __iomem *scu_base = scu_base_addr();
 	unsigned int i, ncores;
@@ -149,6 +149,8 @@ static void __init ux500_smp_init_cpus(void)
 
 	for (i = 0; i < ncores; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init ux500_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index 52d768f..1ab85e7 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -97,7 +97,7 @@ static int zynq_boot_secondary(unsigned int cpu,
  * Initialise the CPU possible map early - this describes the CPUs
  * which may be present or become present in the system.
  */
-static void __init zynq_smp_init_cpus(void)
+static int __init zynq_smp_init_cpus(void)
 {
 	int i;
 
@@ -105,6 +105,8 @@ static void __init zynq_smp_init_cpus(void)
 
 	for (i = 0; i < ncores && i < CONFIG_NR_CPUS; i++)
 		set_cpu_possible(i, true);
+
+	return ncores;
 }
 
 static void __init zynq_smp_prepare_cpus(unsigned int max_cpus)
-- 
1.9.1


  reply	other threads:[~2015-01-19 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 16:52 [PATCH 1/3] ARM: Marvell: Remove init cpus function Daniel Lezcano
2015-01-19 16:53 ` Daniel Lezcano [this message]
2015-01-19 16:53 ` [PATCH 3/3] ARM: Factor out the smp_init_cpus function Daniel Lezcano
2015-01-19 17:53 ` [PATCH 1/3] ARM: Marvell: Remove init cpus function Gregory CLEMENT
2015-01-19 21:30 ` Andrew Lunn
2015-01-19 22:02   ` Daniel Lezcano
2015-01-23 13:15 ` Daniel Lezcano

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=1421686381-12397-2-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=thomas.petazzoni@free-electrons.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

Powered by JetHome