summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
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/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C
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/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C')
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.C100
1 files changed, 64 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>;
OpenPOWER on IntegriCloud