linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case
@ 2015-11-23 11:59 nyushchenko at dev.rtsoft.ru
  2015-11-23 12:03 ` Russell King - ARM Linux
  0 siblings, 1 reply; 16+ messages in thread
From: nyushchenko at dev.rtsoft.ru @ 2015-11-23 11:59 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>

While running an imx6s boasrd, I got following message in boot log:

[    0.032414] CPU1: failed to boot: -38

This looked strange: imx6s is singe-core and kernel perfectly knows
that. However, for some reason it tries to initialize CPU 1?

I found this to be caused by
- CONFIG_SMP_ON_UP successfully detects that system is single core,
- this causes is_smp() to return false,
- this causes setup_arch() to skip smp_init_cpus() call,
- this skips board-specific code that sets cpu_possible mask.

By looking at the code, I don't understand why several initialization
routines are called only in is_smp() case - while other kernel
CONFIG_SMP code does not check is_smp() every time and uses what should
have been initialized by skipped routines.

Thus I propose making these init calls regardless of is_smp() check.
Calls are already conditional on CONFIG_SMP. This will make init and
usage sides consistent.

Signed-off-by: Nikita Yushchenko <nyushchenko@dev.rtsoft.ru>
---
 arch/arm/kernel/setup.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 20edd34..8a14fce 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -980,16 +980,14 @@ void __init setup_arch(char **cmdline_p)
 	psci_dt_init();
 	xen_early_init();
 #ifdef CONFIG_SMP
-	if (is_smp()) {
-		if (!mdesc->smp_init || !mdesc->smp_init()) {
-			if (psci_smp_available())
-				smp_set_ops(&psci_smp_ops);
-			else if (mdesc->smp)
-				smp_set_ops(mdesc->smp);
-		}
-		smp_init_cpus();
-		smp_build_mpidr_hash();
+	if (!mdesc->smp_init || !mdesc->smp_init()) {
+		if (psci_smp_available())
+			smp_set_ops(&psci_smp_ops);
+		else if (mdesc->smp)
+			smp_set_ops(mdesc->smp);
 	}
+	smp_init_cpus();
+	smp_build_mpidr_hash();
 #endif
 
 	if (!is_smp())
-- 
2.1.4

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

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

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 11:59 [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case nyushchenko at dev.rtsoft.ru
2015-11-23 12:03 ` Russell King - ARM Linux
2015-11-23 12:06   ` Nikita Yushchenko
2015-11-23 12:12     ` Russell King - ARM Linux
2015-11-23 12:19       ` Russell King - ARM Linux
2015-11-23 12:46         ` Nikita Yushchenko
2015-11-23 12:32     ` Vladimir Murzin
2015-11-23 12:42       ` Nikita Yushchenko
2015-11-23 12:47         ` Nikita Yushchenko
2015-11-23 13:04           ` Russell King - ARM Linux
2015-11-24 14:52             ` Nikita Yushchenko
2015-11-24 15:05               ` Nikita Yushchenko
2015-11-24 15:28                 ` Nikita Yushchenko
2015-11-24 15:33               ` Russell King - ARM Linux
2015-11-28 11:13                 ` Nikita Yushchenko
2015-11-30  8:25                   ` Nikita Yushchenko

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).