From cebb6844170e4085ecb6fa2bb2cb5851d41ca641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 6 May 2018 07:00:40 +0300 Subject: console: Skip non-BSP printk() earlier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix regression after commit: 6032018 console: only allow console messages after initialization Bail out early on AP CPUs, this avoids use of CAR_GLOBAL when we have SQUELCH_EARLY_SMP=y. Change-Id: I506c5fbec43a6eb6f6d9362d62a040def9e1e7bb Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/26120 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Aaron Durbin --- src/console/printk.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/console/printk.c b/src/console/printk.c index 2f7e27719b..c10cf97dc4 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -44,13 +44,12 @@ int do_printk(int msg_level, const char *fmt, ...) va_list args; int i; - if (!console_log_level(msg_level)) + if (IS_ENABLED(CONFIG_SQUELCH_EARLY_SMP) && ENV_CACHE_AS_RAM && + !boot_cpu()) return 0; -#if IS_ENABLED (CONFIG_SQUELCH_EARLY_SMP) && defined(__PRE_RAM__) - if (!boot_cpu()) + if (!console_log_level(msg_level)) return 0; -#endif DISABLE_TRACE; #ifdef __PRE_RAM__ -- cgit v1.2.3