Skip to content

Commit

Permalink
Do nothing with error logs after shutdown event is received.
Browse files Browse the repository at this point in the history
Disable processing of error logs by the error log server
after receiving the shutdown event.  This is to prevent
the possibility of bad things from happening once other
services are shutdown.

CQ: SW465848
Change-Id: I59c4951182d43a78f5704b4b4c3379f10dd03182
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/85278
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-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>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
milesg-github authored and dcrowell77 committed Oct 15, 2019
1 parent df80bf4 commit 9f92316
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/include/usr/errl/errlmanager.H
Expand Up @@ -477,6 +477,11 @@ private:
*/
bool iv_pnorReadyForErrorLogs;

/**
* @brief Indicates if we have processed a shutdown event message
*/
bool iv_recvdShutdownEvent;

/**
* @brief
* Pointer to the header that precedes the error log storage buffer
Expand Down
28 changes: 28 additions & 0 deletions src/usr/errl/errlmanager.C
Expand Up @@ -138,6 +138,7 @@ AtLoadFunctions atLoadFunction;
///////////////////////////////////////////////////////////////////////////////
ErrlManager::ErrlManager() :
iv_pnorReadyForErrorLogs(false),
iv_recvdShutdownEvent(false),
iv_hwasProcessCalloutFn(NULL),
iv_msgQ(NULL),
iv_pnorAddr(NULL),
Expand Down Expand Up @@ -290,6 +291,30 @@ void ErrlManager::errlogMsgHndlr ()
msg_t * theMsg = msg_wait( iv_msgQ );
TRACFCOMP( g_trac_errl, INFO_MRK"Got an error log Msg - Type: 0x%08x",
theMsg->type );

// if we've been shut down then do nothing except delete the msg or send
// a response depending on the message type.
if(iv_recvdShutdownEvent)
{
TRACFCOMP( g_trac_errl, INFO_MRK "Error log service is shutdown. "
"Message will be ignored.");
switch( theMsg->type )
{
// Shutdown and flush message types expect a response
case ERRLOG_SHUTDOWN_TYPE:
case ERRLOG_FLUSH_TYPE:
msg_respond ( iv_msgQ, theMsg );
break;

// All other messages just need to be freed
default:
msg_free(theMsg);
break;
}
// wait for next message
continue;
}

//Process message just received
switch( theMsg->type )
{
Expand Down Expand Up @@ -1029,6 +1054,9 @@ void ErrlManager::errlogShutdown()
// prior to the PNOR resource provider shutting down.
PNOR::flush(PNOR::HB_ERRLOGS);

// Remember that we have recieved the shutdown event
iv_recvdShutdownEvent = true;

return;
}

Expand Down

0 comments on commit 9f92316

Please sign in to comment.