Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: avoid SMP DT initialisation on UP-only capable systems
@ 2015-11-25 10:43 Russell King
  2015-11-25 11:35 ` Mark Rutland
  0 siblings, 1 reply; 6+ messages in thread
From: Russell King @ 2015-11-25 10:43 UTC (permalink / raw)
  To: linux-arm-kernel

arm_dt_init_cpu_maps() initialises the CPU possible map even when the
boot CPU indicates that it is not SMP capable.  This can happen with
SoCs where the SoC may have a single UP-only CPU, or may have a pair of
SMP CPUs - and this is the only difference.

One solution is to increase the number of DT files by forcing peopl to
properly describe the hardware: this means all the iMX6DL DT files need
to be duplicated for iMX6S and a whole raft of updates to boot loaders
and the like.

Another solution is to decide that it is inappropriate to initialise the
cpu_possible map with anything but the boot CPU on non-SMP capable
systems.  This is implemented by this patch.

The situation currently may provoke a warning on earlier kernels,
printed during SMP bringup where we attempt to bring CPU1 online inspite
of CPU0 being a UP-only CPU, and this only failing due to the lack of
SMP operations.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/kernel/devtree.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 65addcbf5b30..bd72ce91d7a2 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -170,15 +170,18 @@ void __init arm_dt_init_cpu_maps(void)
 		return;
 	}
 
-	/*
-	 * Since the boot CPU node contains proper data, and all nodes have
-	 * a reg property, the DT CPU list can be considered valid and the
-	 * logical map created in smp_setup_processor_id() can be overridden
-	 */
-	for (i = 0; i < cpuidx; i++) {
-		set_cpu_possible(i, true);
-		cpu_logical_map(i) = tmp_map[i];
-		pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i));
+	if (is_smp()) {
+		/*
+		 * Since the boot CPU node contains proper data, and all
+		 * nodes have a reg property, the DT CPU list can be
+		 * considered valid and the logical map created in
+		 * smp_setup_processor_id() can be overridden
+		 */
+		for (i = 0; i < cpuidx; i++) {
+			set_cpu_possible(i, true);
+			cpu_logical_map(i) = tmp_map[i];
+			pr_debug("cpu logical map 0x%x\n", cpu_logical_map(i));
+		}
 	}
 }
 
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-25 14:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25 10:43 [PATCH] ARM: avoid SMP DT initialisation on UP-only capable systems Russell King
2015-11-25 11:35 ` Mark Rutland
2015-11-25 11:49   ` Russell King - ARM Linux
2015-11-25 12:50     ` Lucas Stach
2015-11-25 12:56       ` Russell King - ARM Linux
2015-11-25 14:06         ` Jon Nettleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox