From 60320182d011a8c31793f833f36f65cd5e8b50df Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 28 Feb 2018 12:38:05 -0700 Subject: console: only allow console messages after initialization The console subsystem allows printk() to be called prior to the drivers and/or infrastructure is completely set up. In those situations don't allow messages to be added until the console is completely initialized. BUG=b:73898539 Change-Id: Idc3840132d7f95f8e22045d7484c528d828bb0de Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/24917 Reviewed-by: Paul Menzel Reviewed-by: Furquan Shaikh Tested-by: build bot (Jenkins) --- src/console/init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/console/init.c b/src/console/init.c index 78c568f96e..8f71b09881 100644 --- a/src/console/init.c +++ b/src/console/init.c @@ -14,6 +14,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -29,10 +30,13 @@ #define CONSOLE_LEVEL_CONST 0 #endif +static int console_inited CAR_GLOBAL; static int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; static inline int get_log_level(void) { + if (car_get_var(console_inited) == 0) + return -1; if (CONSOLE_LEVEL_CONST) return get_console_loglevel(); @@ -74,6 +78,8 @@ asmlinkage void console_init(void) console_hw_init(); + car_set_var(console_inited, 1); + printk(BIOS_NOTICE, "\n\ncoreboot-%s%s %s " ENV_STRING " starting...\n", coreboot_version, coreboot_extra_version, coreboot_build); } -- cgit v1.2.3