[4/5] ARM: actions: Set possible CPUs from ncores
diff mbox series

Message ID 20181211080759.3150-4-linus.walleij@linaro.org
State New
Headers show
Series
  • [1/5] ARM: actions: Put OF nodes after use
Related show

Commit Message

Linus Walleij Dec. 11, 2018, 8:07 a.m. UTC
The codes figured out how many cores the SCU is reporting
so let's say that these CPUs are usable.

Possibly this code is redundant to the device tree parsing
code looping over the CPUs in arch/arm/kernel/devtree.c
but most other platform do this and it looks coherent.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-actions/platsmp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Russell King - ARM Linux admin Dec. 12, 2018, 11:21 a.m. UTC | #1
On Tue, Dec 11, 2018 at 09:07:58AM +0100, Linus Walleij wrote:
> The codes figured out how many cores the SCU is reporting
> so let's say that these CPUs are usable.
> 
> Possibly this code is redundant to the device tree parsing
> code looping over the CPUs in arch/arm/kernel/devtree.c
> but most other platform do this and it looks coherent.

Maybe it's another cargo-cult issue - presumably the platform already
boots fine without this, so it is likely redundant.

Patch
diff mbox series

diff --git a/arch/arm/mach-actions/platsmp.c b/arch/arm/mach-actions/platsmp.c
index b66a768afedd..26ddc12ea4a7 100644
--- a/arch/arm/mach-actions/platsmp.c
+++ b/arch/arm/mach-actions/platsmp.c
@@ -111,6 +111,7 @@  static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 	static void __iomem *scu_base_addr;
 	struct device_node *node;
 	static int ncores;
+	int i;
 
 	node = of_find_compatible_node(NULL, NULL, "actions,s500-timer");
 	if (!node) {
@@ -162,6 +163,11 @@  static void __init s500_smp_prepare_cpus(unsigned int max_cpus)
 		pr_debug("%s: ncores %d\n", __func__, ncores);
 
 		scu_enable(scu_base_addr);
+
+		for (i = 0; i < ncores; i++)
+			set_cpu_possible(i, true);
+
+		iounmap(scu_base_addr);
 	}
 }