summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-12-04 16:10:28 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-12-12 15:34:18 -0600
commit1fe455d3400fd80d99176ad7f60a630ac7ce1b76 (patch)
treeae8b23e794687be12fdd8f1f91dafb4e26b708e5 /src
parentcc2021f69f6b0a1d8e271a8fd15650bd204702bd (diff)
downloadtalos-hostboot-1fe455d3400fd80d99176ad7f60a630ac7ce1b76.tar.gz
talos-hostboot-1fe455d3400fd80d99176ad7f60a630ac7ce1b76.zip
fix minor issues in errlmanager code
. on ack from FSP, check ToSave list; remove if there; . remove checks that don't need to be there; Change-Id: Id518625fd5efb4a8d6666d80e6310e8e02869874 RTC: 92123 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7554 Reviewed-by: Donald E. Dahle <dedahle@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/include/usr/errl/errlmanager.H6
-rw-r--r--src/usr/errl/errlmanager.C58
2 files changed, 44 insertions, 20 deletions
diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H
index 2d3a21edd..23319a81a 100644
--- a/src/include/usr/errl/errlmanager.H
+++ b/src/include/usr/errl/errlmanager.H
@@ -355,10 +355,10 @@ private:
* @brief find the flattened error log in PNOR and set it's ACK bit
*
* @param[in] i_errEid EID of the error log to look for
- * @return NONE
- *
+ * @return true if we successfully set the ACK bit,
+ * false if we couldn't find that errlog in PNOR
*/
- void ackErrLogInPnor( uint32_t i_errEid );
+ bool ackErrLogInPnor( uint32_t i_errEid );
/**
* @brief check the state of the PNOR 'slot'
diff --git a/src/usr/errl/errlmanager.C b/src/usr/errl/errlmanager.C
index 05221f034..06d78c59c 100644
--- a/src/usr/errl/errlmanager.C
+++ b/src/usr/errl/errlmanager.C
@@ -319,11 +319,8 @@ void ErrlManager::errlogMsgHndlr ()
TRACFCOMP(g_trac_errl, ERR_MRK "Failed sending error log to FSP");
//Free the extra data due to the error
- if( (msg != NULL) && (msg->extra_data != NULL) )
- {
- free( msg->extra_data );
- msg_free( msg );
- }
+ free( msg->extra_data );
+ msg_free( msg );
delete l_err;
l_err = NULL;
@@ -425,7 +422,33 @@ void ErrlManager::errlogMsgHndlr ()
uint32_t l_tmpPlid = theMsg->data[0]>>32;
TRACFCOMP( g_trac_errl, INFO_MRK"ack: %.8x", l_tmpPlid);
- ackErrLogInPnor(l_tmpPlid);
+ bool didAck = ackErrLogInPnor(l_tmpPlid);
+
+ if (!didAck)
+ {
+ // couldn't find that errlog in PNOR, look in our
+ // ToSave list - maybe it's there waiting
+ for (std::list<errlHndl_t>::iterator
+ it = iv_errlToSave.begin();
+ it != iv_errlToSave.end();
+ it++)
+ {
+ errlHndl_t l_err = *it;
+ if (l_err->eid() == l_tmpPlid)
+ {
+ // we found it
+ // done with the error log handle so delete it.
+ delete l_err;
+ l_err = NULL;
+
+ // delete from the list
+ iv_errlToSave.erase(it);
+
+ // break out of the for loop - we're done
+ break;
+ }
+ } // for
+ }
msg_free(theMsg);
@@ -448,7 +471,7 @@ void ErrlManager::errlogMsgHndlr ()
// delete from the list
iv_errlToSave.pop_front();
}
- // else, still couldn't save it (for some reason??) so
+ // else, still couldn't save it (for some reason) so
// it's still on the list.
}
break;
@@ -526,12 +549,9 @@ msg_t *ErrlManager::sendErrLogToMbox ( errlHndl_t& io_err )
TRACFCOMP(g_trac_errl, ERR_MRK"Failed sending error log to FSP");
//Free the extra data due to the error
- if( (msg != NULL) && (msg->extra_data != NULL) )
- {
- free( msg->extra_data );
- msg_free( msg );
- msg = NULL;
- }
+ free( msg->extra_data );
+ msg_free( msg );
+ msg = NULL;
delete l_err;
l_err = NULL;
@@ -947,7 +967,8 @@ bool ErrlManager::saveErrLogToPnor( errlHndl_t& io_err)
char *l_pnorAddr = iv_pnorAddr + (PNOR_ERROR_LENGTH * iv_pnorOpenSlot);
TRACDBIN( g_trac_errl, INFO_MRK"saveErrLogToPnor: l_pnorAddr before",
l_pnorAddr, 128);
- int l_errSize = io_err->flatten(l_pnorAddr, PNOR_ERROR_LENGTH, true);
+ uint64_t l_errSize = io_err->flatten(l_pnorAddr,
+ PNOR_ERROR_LENGTH, true);
if (l_errSize !=0)
{
TRACFCOMP( g_trac_errl, INFO_MRK"saveErrLogToPnor: %d bytes flattened into %p, slot %d",
@@ -984,9 +1005,10 @@ bool ErrlManager::saveErrLogToPnor( errlHndl_t& io_err)
///////////////////////////////////////////////////////////////////////////////
// ErrlManager::ackErrLogInPnor()
///////////////////////////////////////////////////////////////////////////////
-void ErrlManager::ackErrLogInPnor( uint32_t i_errEid )
+bool ErrlManager::ackErrLogInPnor( uint32_t i_errEid )
{
TRACFCOMP( g_trac_errl, ENTER_MRK"ackErrLogInPnor(%.8x)", i_errEid);
+ bool rc = true;
// look for an un-ACKed log that matches this eid
uint32_t i;
@@ -1009,10 +1031,12 @@ void ErrlManager::ackErrLogInPnor( uint32_t i_errEid )
{
//could not find the errorlog to mark for acknowledgment
TRACFCOMP( g_trac_errl, ERR_MRK"ackErrLogInPnor failed to find the error log" );
+ rc = false;
}
- TRACFCOMP( g_trac_errl, EXIT_MRK"ackErrLogInPnor" );
- return;
+ TRACFCOMP( g_trac_errl, EXIT_MRK"ackErrLogInPnor returning %s",
+ rc ? "true" : "false");
+ return rc;
} // ackErrLogInPnor
OpenPOWER on IntegriCloud