summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2017-04-07 16:11:02 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2017-04-13 14:35:37 -0400
commitd66fd028b7c2ed1fe2551e1b3726d7a033aee8bc (patch)
tree794887b5bf2a85c86fb5db45ca9510f08349efea /src
parent574d762c9b73bd58dffe76cdaae50af1da8c5c88 (diff)
downloadtalos-hostboot-d66fd028b7c2ed1fe2551e1b3726d7a033aee8bc.tar.gz
talos-hostboot-d66fd028b7c2ed1fe2551e1b3726d7a033aee8bc.zip
PRD: consolidated cmd complete analysis in MemTdCtlr
Change-Id: Ia7d9c48acc5f95cee6908c1d77f4f60c04c57642 RTC: 171915 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/39106 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C100
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H12
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C14
3 files changed, 90 insertions, 36 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
index 335838ba7..40e0e4a54 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
@@ -83,49 +83,16 @@ uint32_t MemTdCtlr<T>::handleCmdComplete( STEP_CODE_DATA_STRUCT & io_sc )
{
// There are no TD procedures currently in progress.
- // First, keep track of where the command stopped. Must be done
- // before calling checkEcc().
- o_rc = initStoppedRank();
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "initStoppedRank() failed" );
- break;
- }
-
- // Then, check for ECC errors, if they exist.
+ // Check for ECC errors, if they exist.
bool errorsFound = false;
- o_rc = checkEcc( errorsFound, io_sc );
+ o_rc = analyzeCmdComplete( errorsFound, io_sc );
if ( SUCCESS != o_rc )
{
- PRDF_ERR( PRDF_FUNC "checkEcc(0x%08x) failed",
+ PRDF_ERR( PRDF_FUNC "analyzeCmdComplete(0x%08x) failed",
iv_chip->getHuid() );
break;
}
- #ifdef __HOSTBOOT_RUNTIME
-
- // If the queue is still empty then it is possible that background
- // scrubbing only stopped for FFDC. In that case, simply resume the
- // command instead of starting a new one.
- if ( iv_queue.empty() )
- {
- // It is possible to get here if we were running a TD procedure
- // and the PRD service is reset. Therefore, we much check if
- // background scrubbing was actually configured.
- bool isBgScrub;
- o_rc = isBgScrubConfig<T>( iv_chip, isBgScrub );
- if ( SUCCESS != o_rc )
- {
- PRDF_ERR( PRDF_FUNC "isBgScrubConfig(0x%08x) failed",
- iv_chip->getHuid() );
- break;
- }
-
- if ( isBgScrub ) iv_resumeBgScrub = true;
- }
-
- #endif
-
// If the command completed successfully with no error, the error
// log will not have any useful information. Therefore, do not
// commit the error log. This is done to avoid useless
@@ -291,6 +258,67 @@ uint32_t MemTdCtlr<TYPE_MBA>::initStoppedRank()
//------------------------------------------------------------------------------
+template<TARGETING::TYPE T>
+uint32_t MemTdCtlr<T>::analyzeCmdComplete( bool & o_errorsFound,
+ STEP_CODE_DATA_STRUCT & io_sc )
+{
+ #define PRDF_FUNC "[MemTdCtlr::analyzeCmdComplete] "
+
+ uint32_t o_rc = SUCCESS;
+
+ do
+ {
+ // First, keep track of where the command stopped. Must be done
+ // before calling checkEcc().
+ o_rc = initStoppedRank();
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "initStoppedRank() failed" );
+ break;
+ }
+
+ // Then, check for ECC errors, if they exist.
+ o_rc = checkEcc( o_errorsFound, io_sc );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "checkEcc(0x%08x) failed",
+ iv_chip->getHuid() );
+ break;
+ }
+
+ #ifdef __HOSTBOOT_RUNTIME
+
+ // If the queue is still empty then it is possible that background
+ // scrubbing only stopped for FFDC. In that case, simply resume the
+ // command instead of starting a new one.
+ if ( iv_queue.empty() )
+ {
+ // It is possible to get here if we were running a TD procedure
+ // and the PRD service is reset. Therefore, we must check if
+ // background scrubbing was actually configured.
+ bool isBgScrub;
+ o_rc = isBgScrubConfig<T>( iv_chip, isBgScrub );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "isBgScrubConfig(0x%08x) failed",
+ iv_chip->getHuid() );
+ break;
+ }
+
+ if ( isBgScrub ) iv_resumeBgScrub = true;
+ }
+
+ #endif
+
+ } while (0);
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
// Avoid linker errors with the template.
template class MemTdCtlr<TYPE_MCBIST>;
template class MemTdCtlr<TYPE_MBA>;
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H
index 402e42ee6..000339b48 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H
@@ -188,6 +188,18 @@ class MemTdCtlr
uint32_t checkEcc( bool & o_errorsFound, STEP_CODE_DATA_STRUCT & io_sc );
/**
+ * @brief This is called when handling a command complete attention for a
+ * non-TD command to initialize iv_stoppedRank and iv_broadcastMode
+ * then check for any ECC errors.
+ * @param o_errorsFound True if errors where found and handled. False
+ * otherwise.
+ * @param io_sc The step code data struct.
+ * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
+ */
+ uint32_t analyzeCmdComplete( bool & o_errorsFound,
+ STEP_CODE_DATA_STRUCT & io_sc );
+
+ /**
* @brief Adds the TD controller state to the capture data.
* @param io_sc The step code data struct.
* @param i_startEnd Description tag for the capture data. Used to
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
index 1d57da634..82087347b 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C
@@ -81,6 +81,20 @@ uint32_t MemTdCtlr<T>::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc,
// relevant registers that may have changed since the initial capture.
// TODO: RTC 166837
+ // It is possible that background scrub could have found an ECC error
+ // before we had a chance to stop the command. Therefore, we need to
+ // call analyzeCmdComplete() first so that any ECC errors found can be
+ // handled. Also, analyzeCmdComplete() will initialize the variables
+ // needed so we know where to restart background scrubbing.
+ bool junk = false;
+ o_rc = analyzeCmdComplete( junk, io_sc );
+ if ( SUCCESS != o_rc )
+ {
+ PRDF_ERR( PRDF_FUNC "analyzeCmdComplete(0x%08x) failed",
+ iv_chip->getHuid() );
+ break;
+ }
+
// Move onto the next step in the state machine.
o_rc = nextStep( io_sc );
if ( SUCCESS != o_rc )
OpenPOWER on IntegriCloud