Skip to content

Commit

Permalink
PRD: fixed priority of PreAnalysis function
Browse files Browse the repository at this point in the history
There was and issue where the PreAnalysis plugin would change the secondary
attention type, but normal analysis afterward will continue to use the
previous secondary attention type.

Change-Id: I405f52a02c066831d37d7c670f38b1542fd730e5
CQ: SW443161
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64944
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65136
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
  • Loading branch information
zane131 committed Aug 25, 2018
1 parent c3b2b32 commit 8034c8c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 51 deletions.
10 changes: 6 additions & 4 deletions src/usr/diag/prdf/common/rule/prdfRuleChip.C
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ int32_t RuleChip::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
ServiceDataCollector & i_sdc = *(i_serviceData.service_data);
ErrorSignature & l_errSig = *(i_sdc.GetErrorSignature());

// Set current ATTN type to input value.
// If we don't do this, then the AttnRegisters don't work.
i_sdc.setSecondaryAttnType(i_attnType);
// Set the secondary attention type. This must be done before calling
// Analyze() on iv_pRuleData.
i_sdc.setSecondaryAttnType( i_attnType );

// Set Signature Chip Id.
l_errSig.setChipId( GetId() );
l_rc = iv_pRuleData->Analyze( i_serviceData, i_attnType );

l_rc = iv_pRuleData->Analyze( i_serviceData );

return l_rc;
};
Expand Down
87 changes: 43 additions & 44 deletions src/usr/diag/prdf/common/rule/prdfRuleMetaData.C
Original file line number Diff line number Diff line change
Expand Up @@ -394,25 +394,24 @@ errlHndl_t RuleMetaData::loadRuleFile( ScanFacility & i_scanFactory ,

//------------------------------------------------------------------------------

int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
ATTENTION_TYPE i_attnType )
int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & io_sc )
{
int32_t l_rc = SUCCESS;
ExtensibleChip * l_chipAnalyzed = ServiceDataCollector::getChipAnalyzed( );
ServiceDataCollector & i_sdc = *(i_serviceData.service_data);
ServiceDataCollector & i_sdc = *(io_sc.service_data);
// Set default dump flags.
i_sdc.SetDump( (hwTableContent)cv_dumpType,
l_chipAnalyzed->GetChipHandle() );
// Add statement below for Drop call.
CaptureData & capture = i_serviceData.service_data->GetCaptureData();
CaptureData & capture = io_sc.service_data->GetCaptureData();
// Get capture data for this chip. Allow override.
ExtensibleChipFunction * l_ignoreCapture =
getExtensibleFunction("PreventDefaultCapture", true);
bool l_shouldPreventDefaultCapture = false;

(*l_ignoreCapture)
( l_chipAnalyzed, PluginDef::bindParm<STEP_CODE_DATA_STRUCT&, bool&>
(i_serviceData, l_shouldPreventDefaultCapture));
(io_sc, l_shouldPreventDefaultCapture));

if (!l_shouldPreventDefaultCapture)
{
Expand All @@ -423,48 +422,48 @@ int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
this->CaptureErrorData( i_sdc.GetCaptureData() );
}

// Analyze group.
ErrorRegisterType * l_errReg = NULL;
switch (i_attnType)
// Call the PreAnalysis plugin, if it exist. This should be done
// before getting the error register just in case the secondary attention
// type changes in the pre-analysis.
ExtensibleChipFunction * l_preAnalysis =
getExtensibleFunction("PreAnalysis", true);
bool analyzed = false;
(*l_preAnalysis)( l_chipAnalyzed,
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&>(io_sc,analyzed) );

if ( !analyzed )
{
case CHECK_STOP:
l_errReg = cv_groupAttn[0];
break;
// Analyze the group.
ErrorRegisterType * l_errReg = nullptr;
switch ( io_sc.service_data->getSecondaryAttnType() )
{
case CHECK_STOP:
l_errReg = cv_groupAttn[0];
break;

case RECOVERABLE:
l_errReg = cv_groupAttn[1];
break;
case RECOVERABLE:
l_errReg = cv_groupAttn[1];
break;

case SPECIAL:
l_errReg = cv_groupAttn[2];
break;
case SPECIAL:
l_errReg = cv_groupAttn[2];
break;

case UNIT_CS:
l_errReg = cv_groupAttn[3];
break;
case UNIT_CS:
l_errReg = cv_groupAttn[3];
break;

case HOST_ATTN:
l_errReg = cv_groupAttn[4];
break;
case HOST_ATTN:
l_errReg = cv_groupAttn[4];
break;
}

l_rc = ( nullptr != l_errReg ) ? l_errReg->Analyze(io_sc)
: PRD_SCAN_COMM_REGISTER_ZERO;
}
if (NULL != l_errReg)
{ //mp02 a Start
//Call any pre analysis functions
ExtensibleChipFunction * l_preAnalysis =
getExtensibleFunction("PreAnalysis", true);
bool analyzed = false;
(*l_preAnalysis)( l_chipAnalyzed ,
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&>
(i_serviceData,analyzed));
if ( !analyzed)
l_rc = l_errReg->Analyze(i_serviceData);
} //mp02 a Stop
// mp02d l_rc = l_errReg->Analyze(i_serviceData);
else //@jl07
l_rc = PRD_SCAN_COMM_REGISTER_ZERO; //@jl07

// Don't do reset or mask on CS. @pw03
if (CHECK_STOP != i_serviceData.service_data->getPrimaryAttnType()) //@pw04
if (CHECK_STOP != io_sc.service_data->getPrimaryAttnType()) //@pw04
{
#ifndef __HOSTBOOT_MODULE
SyncAnalysis (i_sdc); //mp01 Add call to Sync SDC
Expand All @@ -474,26 +473,26 @@ int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
#if defined(__HOSTBOOT_MODULE) || defined(ESW_SIM_COMPILE)

// Call mask plugin.
if (i_serviceData.service_data->IsAtThreshold())
if (io_sc.service_data->IsAtThreshold())
{
ExtensibleChipFunction * l_mask =
getExtensibleFunction("MaskError", true);
(*l_mask)( l_chipAnalyzed ,
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(io_sc)
); //@pw01
}

// Call reset plugin.
ExtensibleChipFunction * l_reset =
getExtensibleFunction("ResetError", true);
(*l_reset)( l_chipAnalyzed,
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(io_sc)
); //@pw01
#endif
}

// Additional error isolation for HWPs, if needed.
PlatServices::hwpErrorIsolation( l_chipAnalyzed, i_serviceData );
PlatServices::hwpErrorIsolation( l_chipAnalyzed, io_sc );

// Call postanalysis plugin.
// @jl02 JL Adding PostAnalysis plugin call.
Expand All @@ -502,7 +501,7 @@ int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
// @jl02 the true above means that a plugin may not exist for this call.
// @jl02 JL Adding call for post analysis.
(*l_postanalysis)( l_chipAnalyzed,
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData));
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(io_sc));


return l_rc;
Expand Down
7 changes: 4 additions & 3 deletions src/usr/diag/prdf/common/rule/prdfRuleMetaData.H
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,14 @@ class RuleMetaData
/**
* @brief Analyzes the attention by reading and analyzing group of
* registers.
* @pre Must set the secondary attention type in the SDC before
* calling this function.
* @param[io] io_serviceData reference to STEP_CODE_DATA_STRUCT
* @param[in] i_attn attention reported by RuleChip
* @return SUCCESS|FAIL
*/

int32_t Analyze( STEP_CODE_DATA_STRUCT & io_serviceData,
ATTENTION_TYPE i_attn );
int32_t Analyze( STEP_CODE_DATA_STRUCT & io_serviceData );

/**
* @brief Captures group of register associated with RuleChip
* @param[io] io_capture reference to CaptureData instance.
Expand Down

0 comments on commit 8034c8c

Please sign in to comment.