Skip to content

Commit 8034c8c

Browse files
committed
PRD: fixed priority of PreAnalysis function
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>
1 parent c3b2b32 commit 8034c8c

File tree

3 files changed

+53
-51
lines changed

3 files changed

+53
-51
lines changed

src/usr/diag/prdf/common/rule/prdfRuleChip.C

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ int32_t RuleChip::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
105105
ServiceDataCollector & i_sdc = *(i_serviceData.service_data);
106106
ErrorSignature & l_errSig = *(i_sdc.GetErrorSignature());
107107

108-
// Set current ATTN type to input value.
109-
// If we don't do this, then the AttnRegisters don't work.
110-
i_sdc.setSecondaryAttnType(i_attnType);
108+
// Set the secondary attention type. This must be done before calling
109+
// Analyze() on iv_pRuleData.
110+
i_sdc.setSecondaryAttnType( i_attnType );
111+
111112
// Set Signature Chip Id.
112113
l_errSig.setChipId( GetId() );
113-
l_rc = iv_pRuleData->Analyze( i_serviceData, i_attnType );
114+
115+
l_rc = iv_pRuleData->Analyze( i_serviceData );
114116

115117
return l_rc;
116118
};

src/usr/diag/prdf/common/rule/prdfRuleMetaData.C

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -394,25 +394,24 @@ errlHndl_t RuleMetaData::loadRuleFile( ScanFacility & i_scanFactory ,
394394

395395
//------------------------------------------------------------------------------
396396

397-
int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & i_serviceData,
398-
ATTENTION_TYPE i_attnType )
397+
int32_t RuleMetaData::Analyze( STEP_CODE_DATA_STRUCT & io_sc )
399398
{
400399
int32_t l_rc = SUCCESS;
401400
ExtensibleChip * l_chipAnalyzed = ServiceDataCollector::getChipAnalyzed( );
402-
ServiceDataCollector & i_sdc = *(i_serviceData.service_data);
401+
ServiceDataCollector & i_sdc = *(io_sc.service_data);
403402
// Set default dump flags.
404403
i_sdc.SetDump( (hwTableContent)cv_dumpType,
405404
l_chipAnalyzed->GetChipHandle() );
406405
// Add statement below for Drop call.
407-
CaptureData & capture = i_serviceData.service_data->GetCaptureData();
406+
CaptureData & capture = io_sc.service_data->GetCaptureData();
408407
// Get capture data for this chip. Allow override.
409408
ExtensibleChipFunction * l_ignoreCapture =
410409
getExtensibleFunction("PreventDefaultCapture", true);
411410
bool l_shouldPreventDefaultCapture = false;
412411

413412
(*l_ignoreCapture)
414413
( l_chipAnalyzed, PluginDef::bindParm<STEP_CODE_DATA_STRUCT&, bool&>
415-
(i_serviceData, l_shouldPreventDefaultCapture));
414+
(io_sc, l_shouldPreventDefaultCapture));
416415

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

426-
// Analyze group.
427-
ErrorRegisterType * l_errReg = NULL;
428-
switch (i_attnType)
425+
// Call the PreAnalysis plugin, if it exist. This should be done
426+
// before getting the error register just in case the secondary attention
427+
// type changes in the pre-analysis.
428+
ExtensibleChipFunction * l_preAnalysis =
429+
getExtensibleFunction("PreAnalysis", true);
430+
bool analyzed = false;
431+
(*l_preAnalysis)( l_chipAnalyzed,
432+
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&>(io_sc,analyzed) );
433+
434+
if ( !analyzed )
429435
{
430-
case CHECK_STOP:
431-
l_errReg = cv_groupAttn[0];
432-
break;
436+
// Analyze the group.
437+
ErrorRegisterType * l_errReg = nullptr;
438+
switch ( io_sc.service_data->getSecondaryAttnType() )
439+
{
440+
case CHECK_STOP:
441+
l_errReg = cv_groupAttn[0];
442+
break;
433443

434-
case RECOVERABLE:
435-
l_errReg = cv_groupAttn[1];
436-
break;
444+
case RECOVERABLE:
445+
l_errReg = cv_groupAttn[1];
446+
break;
437447

438-
case SPECIAL:
439-
l_errReg = cv_groupAttn[2];
440-
break;
448+
case SPECIAL:
449+
l_errReg = cv_groupAttn[2];
450+
break;
441451

442-
case UNIT_CS:
443-
l_errReg = cv_groupAttn[3];
444-
break;
452+
case UNIT_CS:
453+
l_errReg = cv_groupAttn[3];
454+
break;
445455

446-
case HOST_ATTN:
447-
l_errReg = cv_groupAttn[4];
448-
break;
456+
case HOST_ATTN:
457+
l_errReg = cv_groupAttn[4];
458+
break;
459+
}
460+
461+
l_rc = ( nullptr != l_errReg ) ? l_errReg->Analyze(io_sc)
462+
: PRD_SCAN_COMM_REGISTER_ZERO;
449463
}
450-
if (NULL != l_errReg)
451-
{ //mp02 a Start
452-
//Call any pre analysis functions
453-
ExtensibleChipFunction * l_preAnalysis =
454-
getExtensibleFunction("PreAnalysis", true);
455-
bool analyzed = false;
456-
(*l_preAnalysis)( l_chipAnalyzed ,
457-
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&>
458-
(i_serviceData,analyzed));
459-
if ( !analyzed)
460-
l_rc = l_errReg->Analyze(i_serviceData);
461-
} //mp02 a Stop
462-
// mp02d l_rc = l_errReg->Analyze(i_serviceData);
463-
else //@jl07
464-
l_rc = PRD_SCAN_COMM_REGISTER_ZERO; //@jl07
465464

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

476475
// Call mask plugin.
477-
if (i_serviceData.service_data->IsAtThreshold())
476+
if (io_sc.service_data->IsAtThreshold())
478477
{
479478
ExtensibleChipFunction * l_mask =
480479
getExtensibleFunction("MaskError", true);
481480
(*l_mask)( l_chipAnalyzed ,
482-
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)
481+
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(io_sc)
483482
); //@pw01
484483
}
485484

486485
// Call reset plugin.
487486
ExtensibleChipFunction * l_reset =
488487
getExtensibleFunction("ResetError", true);
489488
(*l_reset)( l_chipAnalyzed,
490-
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)
489+
PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(io_sc)
491490
); //@pw01
492491
#endif
493492
}
494493

495494
// Additional error isolation for HWPs, if needed.
496-
PlatServices::hwpErrorIsolation( l_chipAnalyzed, i_serviceData );
495+
PlatServices::hwpErrorIsolation( l_chipAnalyzed, io_sc );
497496

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

507506

508507
return l_rc;

src/usr/diag/prdf/common/rule/prdfRuleMetaData.H

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,14 @@ class RuleMetaData
166166
/**
167167
* @brief Analyzes the attention by reading and analyzing group of
168168
* registers.
169+
* @pre Must set the secondary attention type in the SDC before
170+
* calling this function.
169171
* @param[io] io_serviceData reference to STEP_CODE_DATA_STRUCT
170-
* @param[in] i_attn attention reported by RuleChip
171172
* @return SUCCESS|FAIL
172173
*/
173174

174-
int32_t Analyze( STEP_CODE_DATA_STRUCT & io_serviceData,
175-
ATTENTION_TYPE i_attn );
175+
int32_t Analyze( STEP_CODE_DATA_STRUCT & io_serviceData );
176+
176177
/**
177178
* @brief Captures group of register associated with RuleChip
178179
* @param[io] io_capture reference to CaptureData instance.

0 commit comments

Comments
 (0)