From fdca65572e29cfc6ed9842dd6b802ca0e6461421 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= <kyosti.malkki@gmail.com>
Date: Thu, 26 Apr 2018 20:09:54 +0300
Subject: arch/x86: Fix call for wait_other_cpus_stop()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix regression after commit
   0cc2ce4 arch/x86: Clean up CONFIG_SMP and MAX_CPUS test

In case PARALLEL_CPU_INIT=y BSP CPU no longer waited for APs to stop
before proceeding to next bootstates or device initialization.

Change-Id: Ie47e7896ed3d57d98a3ce6766e5c37b6dc22523b
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/25874
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
---
 src/cpu/x86/lapic/lapic_cpu_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src')

diff --git a/src/cpu/x86/lapic/lapic_cpu_init.c b/src/cpu/x86/lapic/lapic_cpu_init.c
index 825739c6df..382b6e4014 100644
--- a/src/cpu/x86/lapic/lapic_cpu_init.c
+++ b/src/cpu/x86/lapic/lapic_cpu_init.c
@@ -568,12 +568,12 @@ void initialize_cpus(struct bus *cpu_bus)
 	/* Initialize the bootstrap processor */
 	cpu_initialize(0);
 
-	if (is_smp_boot() && !IS_ENABLED(CONFIG_PARALLEL_CPU_INIT)) {
+	if (is_smp_boot() && !IS_ENABLED(CONFIG_PARALLEL_CPU_INIT))
 		start_other_cpus(cpu_bus, info->cpu);
 
-		/* Now wait the rest of the cpus stop*/
+	/* Now wait the rest of the cpus stop*/
+	if (is_smp_boot())
 		wait_other_cpus_stop(cpu_bus);
-	}
 
 	if (IS_ENABLED(CONFIG_SERIALIZED_SMM_INITIALIZATION)) {
 		/* At this point, all APs are sleeping:
-- 
cgit v1.2.3