Skip to contentSkip to conversation

ARM: shmobile: Yet another SMP series

PATCH New Magnus Damm 2 participants 8 messages Aug 7, 2013 – Aug 22, 2013

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

cover ARM: shmobile: Yet another SMP series

ARM: shmobile: Yet another SMP series

[PATCH 01/05] ARM: shmobile: Introduce shmobile_smp_cpu_disable() [PATCH 02/05] ARM: shmobile: Use shmobile_smp_cpu_disable() on sh73a0 [PATCH 03/05] ARM: shmobile: Remove unused shmobile_smp_init_cpus() [PATCH 04/05] ARM: shmobile: Expose shmobile_invalidate_start() [PATCH 05/05] ARM: shmobile: Introduce shmobile_boot_size

This series cleans up the existing SMP code and introduces various new SMP functions for mach-shmobile. The new functions are partially used by existing SMP support code, but are also consumed by upcoming SMP support patches.

---

Written against renesas.git renesas-devel-20130806v4

 arch/arm/mach-shmobile/headsmp.S             |    3 +++
 arch/arm/mach-shmobile/include/mach/common.h |    4 +++-
 arch/arm/mach-shmobile/platsmp.c             |   22 +++++++---------------
 arch/arm/mach-shmobile/smp-sh73a0.c          |    9 +--------
 4 files changed, 14 insertions(+), 24 deletions(-)
author maintainer
#1 lore raw

PATCH 1/5 ARM: shmobile: Introduce shmobile_smp_cpu_disable()

From: Magnus Damm <[email protected]>

Introduce the shared CPU Hotplug function shmobile_smp_cpu_disable() for mach-shmobile. It is useful for the case when all CPUs may be hotplugged, including CPU 0.

---

 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 arch/arm/mach-shmobile/platsmp.c             |    7 +++++++
 2 files changed, 8 insertions(+)
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -17,6 +17,7 @@ extern unsigned long shmobile_smp_arg[];
 extern unsigned long shmobile_smp_mpidr[];
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
 			      unsigned long arg);
+extern int shmobile_smp_cpu_disable(unsigned int cpu);
 extern void shmobile_boot_scu(void);
 extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
 extern int shmobile_smp_scu_boot_secondary(unsigned int cpu,
arch/arm/mach-shmobile/platsmp.c +7 -0
@@ -40,3 +40,10 @@ void shmobile_smp_hook(unsigned int cpu,
 	shmobile_smp_arg[cpu] = arg;
 	flush_cache_all();
 }
+
+#ifdef CONFIG_HOTPLUG_CPU
+int shmobile_smp_cpu_disable(unsigned int cpu)
+{
+	return 0; /* Hotplug of any CPU is supported */
+}
+#endif
author maintainer
#2 lore raw

PATCH 2/5 ARM: shmobile: Use shmobile_smp_cpu_disable() on sh73a0

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Use shmobile_smp_cpu_disable() on sh73a0 since it
allows CPU Hotplug of any CPU.

---

 arch/arm/mach-shmobile/smp-sh73a0.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/arm/mach-shmobile/smp-sh73a0.c +1 -8
@@ -71,18 +71,11 @@ static void __init sh73a0_smp_prepare_cp
 	shmobile_smp_scu_prepare_cpus(max_cpus);
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
-static int sh73a0_cpu_disable(unsigned int cpu)
-{
-	return 0; /* CPU0 and CPU1 supported */
-}
-#endif /* CONFIG_HOTPLUG_CPU */
-
 struct smp_operations sh73a0_smp_ops __initdata = {
 	.smp_prepare_cpus	= sh73a0_smp_prepare_cpus,
 	.smp_boot_secondary	= sh73a0_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-	.cpu_disable		= sh73a0_cpu_disable,
+	.cpu_disable		= shmobile_smp_cpu_disable,
 	.cpu_die		= shmobile_smp_scu_cpu_die,
 	.cpu_kill		= shmobile_smp_scu_cpu_kill,
 #endif
author maintainer
#3 lore raw

PATCH 3/5 ARM: shmobile: Remove unused shmobile_smp_init_cpus()

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Remove shmobile_smp_init_cpus() since all SMP platforms in mach-shmobile now rely on DT for CPU core description instead of for instance determining number of cores from the SCU.

---

 arch/arm/mach-shmobile/include/mach/common.h |    1 -
 arch/arm/mach-shmobile/platsmp.c             |   15 ---------------
 2 files changed, 16 deletions(-)
arch/arm/mach-shmobile/include/mach/common.h +0 -1
@@ -40,7 +40,6 @@ static inline int shmobile_cpuidle_init(
 #endif
 
 extern void __iomem *shmobile_scu_base;
-extern void shmobile_smp_init_cpus(unsigned int ncores);
 
 static inline void __init shmobile_init_late(void)
 {
arch/arm/mach-shmobile/platsmp.c +0 -15
@@ -11,25 +11,10 @@
  * published by the Free Software Foundation.
  */
 #include <linux/init.h>
-#include <linux/smp.h>
 #include <asm/cacheflush.h>
 #include <asm/smp_plat.h>
 #include <mach/common.h>
 
-void __init shmobile_smp_init_cpus(unsigned int ncores)
-{
-	unsigned int i;
-
-	if (ncores > nr_cpu_ids) {
-		pr_warn("SMP: %u cores greater than maximum (%u), clipping\n",
-			ncores, nr_cpu_ids);
-		ncores = nr_cpu_ids;
-	}
-
-	for (i = 0; i < ncores; i++)
-		set_cpu_possible(i, true);
-}
-
 extern unsigned long shmobile_smp_fn[];
 extern unsigned long shmobile_smp_arg[];
 extern unsigned long shmobile_smp_mpidr[];
author maintainer
#4 lore raw

PATCH 4/5 ARM: shmobile: Expose shmobile_invalidate_start()

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Expose shmobile_invalidate_start() in common.h for mach-shmobile. This function will be used for boot of secondary processors on future non-SCU SMP platforms.

---

 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -14,6 +14,7 @@ extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
 			      unsigned long arg);
 extern int shmobile_smp_cpu_disable(unsigned int cpu);
+extern void shmobile_invalidate_start(void);
 extern void shmobile_boot_scu(void);
 extern void shmobile_smp_scu_prepare_cpus(unsigned int max_cpus);
 extern int shmobile_smp_scu_boot_secondary(unsigned int cpu,
author maintainer
#5 lore raw

PATCH 5/5 ARM: shmobile: Introduce shmobile_boot_size

In reply to Magnus Damm

From: Magnus Damm <[email protected]>

Introduce shmobile_boot_size that can be used by
future SMP code to determine the size of the boot
code that needs to be copied to internal SRAM.

---

 arch/arm/mach-shmobile/headsmp.S             |    3 +++
 arch/arm/mach-shmobile/include/mach/common.h |    1 +
 2 files changed, 4 insertions(+)
arch/arm/mach-shmobile/headsmp.S +3 -0
@@ -40,6 +40,9 @@ shmobile_boot_fn:
 	.globl	shmobile_boot_arg
 shmobile_boot_arg:
 2:	.space	4
+	.globl	shmobile_boot_size
+shmobile_boot_size:
+	.long	. - shmobile_boot_vector
 
 /*
  * Per-CPU SMP boot function/argument selection code based on MPIDR
arch/arm/mach-shmobile/include/mach/common.h +1 -0
@@ -9,6 +9,7 @@ extern void shmobile_setup_console(void)
 extern void shmobile_boot_vector(void);
 extern unsigned long shmobile_boot_fn;
 extern unsigned long shmobile_boot_arg;
+extern unsigned long shmobile_boot_size;
 extern void shmobile_smp_boot(void);
 extern void shmobile_smp_sleep(void);
 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
#6 lore raw

cover ARM: shmobile: Yet another SMP series

In reply to Magnus Damm
Quoted 8 lines · Magnus Damm

ARM: shmobile: Yet another SMP series

[PATCH 01/05] ARM: shmobile: Introduce shmobile_smp_cpu_disable() [PATCH 02/05] ARM: shmobile: Use shmobile_smp_cpu_disable() on sh73a0 [PATCH 03/05] ARM: shmobile: Remove unused shmobile_smp_init_cpus() [PATCH 04/05] ARM: shmobile: Expose shmobile_invalidate_start() [PATCH 05/05] ARM: shmobile: Introduce shmobile_boot_size

Quoted 5 lines

This series cleans up the existing SMP code and introduces various new SMP functions for mach-shmobile. The new functions are partially used by existing SMP support code, but are also consumed by upcoming SMP support patches.

Thanks Magnus,

I plan to queue this up in the smp branch which will most likely occur tomorrow.

#7 lore raw

cover ARM: shmobile: Yet another SMP series

Quoted 13 lines · Simon Horman
Quoted 12 lines · Magnus Damm

ARM: shmobile: Yet another SMP series

[PATCH 01/05] ARM: shmobile: Introduce shmobile_smp_cpu_disable() [PATCH 02/05] ARM: shmobile: Use shmobile_smp_cpu_disable() on sh73a0 [PATCH 03/05] ARM: shmobile: Remove unused shmobile_smp_init_cpus() [PATCH 04/05] ARM: shmobile: Expose shmobile_invalidate_start() [PATCH 05/05] ARM: shmobile: Introduce shmobile_boot_size

This series cleans up the existing SMP code and introduces various new SMP functions for mach-shmobile. The new functions are partially used by existing SMP support code, but are also consumed by upcoming SMP support patches.

Quoted 6 lines
Quoted 1 line

Thanks Magnus,

I plan to queue this up in the smp branch which will most likely occur tomorrow.

And indeed it did.