diff options
author | Ilya Smirnov <ismirno@us.ibm.com> | 2018-06-06 14:49:37 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-06-19 17:36:31 -0400 |
commit | 7e0d574dff8853e61634f42acbcb3604dd03cc23 (patch) | |
tree | 45e967918f9830a7a5f0b58ceb0008435d681e83 | |
parent | c7384e829f3dec35cbdf3a18dba432c8fcd1c069 (diff) | |
download | talos-hostboot-7e0d574dff8853e61634f42acbcb3604dd03cc23.tar.gz talos-hostboot-7e0d574dff8853e61634f42acbcb3604dd03cc23.zip |
New Global For Console Daemon
This change implements a new global variable that indicates
whether the console daemon has been started. This variable
is checked in the doShutdown path prior to printing any
console traces.
There may be a situation very early in the IPL where we
attempt to write to console before the console daemon has
been started. This causes timeouts and IPL failures.
Change-Id: Ibec90d2207e5db9ef3b9507503d1ea9e2eb7cf6d
CQ: SW431130
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60060
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/include/util/misc.H | 16 | ||||
-rw-r--r-- | src/lib/utilmisc.C | 13 | ||||
-rw-r--r-- | src/usr/console/daemon.C | 5 | ||||
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.C | 3 |
4 files changed, 33 insertions, 4 deletions
diff --git a/src/include/util/misc.H b/src/include/util/misc.H index 78d17f591..56592a7f8 100644 --- a/src/include/util/misc.H +++ b/src/include/util/misc.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2017 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -55,6 +55,20 @@ namespace Util * @return N/A */ void setIsTargetingLoaded( void ); + + /** + * @brief Determines if the Console daemon has been started + * + * @return bool true if Console daemon has been started; false otherwise + */ + bool isConsoleStarted(); + + /** + * @brief Sets the global variable to indicate that the Console daemon has + * been started. This should only be called once when the console + * daemon starts. + */ + void setIsConsoleStarted(); }; #endif diff --git a/src/lib/utilmisc.C b/src/lib/utilmisc.C index d91af9bc1..36f568d11 100644 --- a/src/lib/utilmisc.C +++ b/src/lib/utilmisc.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2017 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -55,6 +55,17 @@ void setIsTargetingLoaded() g_isTargetingLoaded = true; } +static bool g_isConsoleStarted = false; + +bool isConsoleStarted() +{ + return g_isConsoleStarted; +} + +void setIsConsoleStarted() +{ + g_isConsoleStarted = true; +} }; diff --git a/src/usr/console/daemon.C b/src/usr/console/daemon.C index b51122561..0887afc7c 100644 --- a/src/usr/console/daemon.C +++ b/src/usr/console/daemon.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2017 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ @@ -31,6 +31,7 @@ #include <initservice/initserviceif.H> #include "uart.H" #include "daemon.H" +#include <util/misc.H> extern char hbi_ImageId[]; @@ -72,6 +73,8 @@ namespace CONSOLE Uart::g_device->initialize(); } + Util::setIsConsoleStarted(); + // Display a banner denoting the hostboot version char banner[256]; snprintf(banner, sizeof(banner), diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C index 6ba26e392..2f88aa723 100644 --- a/src/usr/initservice/baseinitsvc/initservice.C +++ b/src/usr/initservice/baseinitsvc/initservice.C @@ -48,6 +48,7 @@ #include <hwas/common/hwas_reasoncodes.H> #include <console/consoleif.H> #include <sbe/sbereasoncodes.H> +#include <util/misc.H> #include <errl/errludstring.H> #include <errl/errludprintk.H> @@ -771,7 +772,7 @@ void InitService::doShutdown(uint64_t i_status, { CONSOLE::displayf(NULL, "System shutting down with error status 0x%X", i_status); - if(VFS::module_is_loaded("libconsole.so")) + if(Util::isConsoleStarted()) { // Only flush the trace when the console module is loaded CONSOLE::flush(); |