Skip to content

Commit

Permalink
PRD: standardized VCM nextStep() and analyzePhase()
Browse files Browse the repository at this point in the history
Change-Id: I6749b898d191abdbee1d43f832784e569b88a0c6
RTC: 193261
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59118
Tested-by: Jenkins Server <pfd-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>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59234
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>
  • Loading branch information
zane131 committed May 23, 2018
1 parent b8037fc commit 7ff47d2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 70 deletions.
2 changes: 1 addition & 1 deletion src/usr/diag/prdf/plat/mem/prdfMemDsd.H
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class DsdEvent : public TdEntry
o_rc = startNextPhase( io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "analyzePhase() failed on 0x%08x,0x%2x",
PRDF_ERR( PRDF_FUNC "startNextPhase() failed on 0x%08x,0x%2x",
iv_chip->getHuid(), getKey() );
break;
}
Expand Down
113 changes: 44 additions & 69 deletions src/usr/diag/prdf/plat/mem/prdfMemVcm.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,35 @@ class VcmEvent : public TdEntry

uint32_t nextStep( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done )
{
#define PRDF_FUNC "[VcmEvent::nextStep] "

uint32_t o_rc = SUCCESS;

o_done = false;

// Take action based on the current phase.
switch ( iv_phase )
do
{
case TD_PHASE_0:
o_rc = startNextPhase( io_sc );
// First, do analysis.
o_rc = analyzePhase( io_sc, o_done );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "analyzePhase() failed on 0x%08x,0x%2x",
iv_chip->getHuid(), getKey() );
break;
}

case TD_PHASE_1:
o_rc = analyzePhase1( io_sc, o_done );
if ( SUCCESS == o_rc && !o_done )
o_rc = startNextPhase( io_sc );
break;
if ( o_done ) break; // Nothing more to do.

case TD_PHASE_2:
o_rc = analyzePhase2( io_sc, o_done );
// Then, start the next phase of the procedure.
o_rc = startNextPhase( io_sc );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "startNextPhase() failed on 0x%08x,0x%2x",
iv_chip->getHuid(), getKey() );
break;
}

default: PRDF_ASSERT( false ); // invalid phase
}

if ( SUCCESS != o_rc )
{
PRDF_ERR( "[VcmEvent::nextStep] failed: 0x%08x,0x%02x",
iv_chip->getHuid(), getKey() );
}
} while (0);

// Add the chip mark to the callout list if no callouts in the list.
if ( 0 == io_sc.service_data->getMruListSize() )
Expand All @@ -104,6 +104,8 @@ class VcmEvent : public TdEntry
}

return o_rc;

#undef PRDF_FUNC
}

uint32_t getKey() const
Expand Down Expand Up @@ -153,56 +155,23 @@ class VcmEvent : public TdEntry
}

/**
* @brief Analyzes the state of the hardware after phase 1 completes.
* @brief Do analysis based on the current phase.
* @param io_sc The step code data struct.
* @param o_done True if the procedure is complete or has aborted.
* @param o_done True if the procedure is complete or has aborted, false
* otherwise.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
uint32_t analyzePhase1( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done )
uint32_t analyzePhase( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done )
{
#define PRDF_FUNC "[VcmEvent::analyzePhase1] "
#define PRDF_FUNC "[VcmEvent::analyzePhase] "

uint32_t o_rc = SUCCESS;

do
{
uint32_t eccAttns;
o_rc = checkEccFirs<T>( iv_chip, eccAttns );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "checkEccFirs(0x%08x) failed",
iv_chip->getHuid() );
break;
}

o_rc = checkEcc( eccAttns, io_sc, o_done );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "checkEcc() failed" );
break;
}

} while (0);

return o_rc;

#undef PRDF_FUNC
}
if ( TD_PHASE_0 == iv_phase ) break; // Nothing to analyze yet.

/**
* @brief Analyzes the state of the hardware after phase 1 completes.
* @param io_sc The step code data struct.
* @param o_done True if the procedure is complete or has aborted.
* @return Non-SUCCESS if an internal function fails, SUCCESS otherwise.
*/
uint32_t analyzePhase2( STEP_CODE_DATA_STRUCT & io_sc, bool & o_done )
{
#define PRDF_FUNC "[VcmEvent::analyzePhase2] "

uint32_t o_rc = SUCCESS;

do
{
// Look for any ECC errors that occurred during the command.
uint32_t eccAttns;
o_rc = checkEccFirs<T>( iv_chip, eccAttns );
if ( SUCCESS != o_rc )
Expand All @@ -212,26 +181,32 @@ class VcmEvent : public TdEntry
break;
}

// Analyze the ECC errors, if needed.
o_rc = checkEcc( eccAttns, io_sc, o_done );
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "checkEcc() failed" );
PRDF_ERR( PRDF_FUNC "checkEcc() failed on 0x%08x",
iv_chip->getHuid() );
break;
}

if ( o_done ) break; // nothing more to do
if ( o_done ) break; // abort the procedure.

// Determine if the chip mark has been verified.
o_rc = (eccAttns & MAINT_MCE) ? verified(io_sc) : falseAlarm(io_sc);
if ( SUCCESS != o_rc )
if ( TD_PHASE_2 == iv_phase )
{
PRDF_ERR( PRDF_FUNC "verified()/falseAlarm() failed" );
break;
// Determine if the chip mark has been verified.
o_rc = (eccAttns & MAINT_MCE) ? verified(io_sc)
: falseAlarm(io_sc);
if ( SUCCESS != o_rc )
{
PRDF_ERR( PRDF_FUNC "verified()/falseAlarm() failed" );
break;
}

// Procedure is complete.
o_done = true;
}

// Procedure is complete.
o_done = true;

} while (0);

#ifdef __HOSTBOOT_RUNTIME
Expand Down

0 comments on commit 7ff47d2

Please sign in to comment.