Skip to content

Commit

Permalink
MDIA: Update getMemTargetsForQueryOrClear for P9
Browse files Browse the repository at this point in the history
Change-Id: I7da8a0ebcf4aebebd43e17aa26a9aa6e58670783
RTC: 168270
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35678
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
  • Loading branch information
cnpalmer authored and zane131 committed Feb 6, 2017
1 parent 181cf8d commit c0a19dc
Showing 1 changed file with 97 additions and 66 deletions.
163 changes: 97 additions & 66 deletions src/usr/diag/mdia/mdiamba.C
Expand Up @@ -71,7 +71,6 @@ errlHndl_t getDiagnosticMode(
o_mode = ONE_PATTERN;
}

/* TODO RTC 168270
// Only need to check hw changed state attributes
// when not already set to exhaustive and not in simics
if(( NINE_PATTERNS != o_mode ) &&
Expand All @@ -82,7 +81,6 @@ errlHndl_t getDiagnosticMode(
o_mode = NINE_PATTERNS;
}
}
*/

} while(0);

Expand Down Expand Up @@ -186,95 +184,128 @@ TargetHandleList getMemTargetsForQueryOrClear(

if( ! dimmList.empty() )
{
o_list.insert(o_list.begin(), dimmList.begin(),
dimmList.end());
o_list.insert(o_list.begin(), dimmList.begin(), dimmList.end());
}

// add associated Centaur
TargetHandleList targetList;
getParentAffinityTargets(targetList,
i_trgt,
CLASS_CHIP,
TYPE_MEMBUF);
TYPE trgtType = i_trgt->getAttr<ATTR_TYPE>();

if( targetList.empty() )
// mcbist target
if ( TYPE_MCBIST == trgtType )
{
MDIA_FAST(FUNC "no connected centaur "
"for mba: %x", get_huid(i_trgt));
break;
}
// add associated MCBIST
o_list.push_back( i_trgt );

TargetHandle_t centaur = targetList[0];
// add associated MCAs
TargetHandleList mcaList;
getChildAffinityTargets(mcaList, i_trgt, CLASS_UNIT, TYPE_MCA);

if ( !mcaList.empty() )
{
o_list.insert( o_list.end(), mcaList.begin(), mcaList.end() );
}

// if query flag is not set, check to make sure
// all of the dimms connected to this centaur
// have cleared hw chagned state attributes
// before adding this centaur/mcs to the list.
// This is needed because we only clear
// the centaur/mcs attribute when all of the
// dimms' attributes from both mbas have cleared.
if(false == i_queryOnly)
}
// MBA target
else
{
targetList.clear();
getChildAffinityTargets(targetList,
centaur,
CLASS_NA,
TYPE_DIMM);
// add associated Centaur
TargetHandleList targetList;
getParentAffinityTargets(targetList,
i_trgt,
CLASS_CHIP,
TYPE_MEMBUF);

if( targetList.empty() )
{
MDIA_FAST(FUNC "no connected centaur "
"for mba: %x", get_huid(i_trgt));
break;
}

TargetHandle_t centaur = targetList[0];

if( ! targetList.empty() )
// if query flag is not set, check to make sure
// all of the dimms connected to this centaur
// have cleared hw chagned state attributes
// before adding this centaur/mcs to the list.
// This is needed because we only clear
// the centaur/mcs attribute when all of the
// dimms' attributes from both mbas have cleared.
if(false == i_queryOnly)
{
TargetHandleList::iterator target;
targetList.clear();
getChildAffinityTargets(targetList,
centaur,
CLASS_NA,
TYPE_DIMM);

for(target = targetList.begin();
target != targetList.end(); ++target)
if( ! targetList.empty() )
{
// exclude dimms belong to the current mba
// because their attributes will be cleared
if(dimmList.end() !=
std::find(dimmList.begin(),
dimmList.end(), *target))
{
continue;
}
TargetHandleList::iterator target;

ATTR_HWAS_STATE_CHANGED_FLAG_type hwChangeFlag;
hwChangeFlag =
(*target)->getAttr<ATTR_HWAS_STATE_CHANGED_FLAG>();

if(HWAS_CHANGED_BIT_MEMDIAG & hwChangeFlag)
for(target = targetList.begin();
target != targetList.end(); ++target)
{
MDIA_FAST(FUNC "hwChangedState is not cleared "
"for dimm: %x", get_huid(*target));
centaur = NULL; // don't add centaur and mcs
break;
// exclude dimms belong to the current mba
// because their attributes will be cleared
if(dimmList.end() !=
std::find(dimmList.begin(),
dimmList.end(), *target))
{
continue;
}

ATTR_HWAS_STATE_CHANGED_FLAG_type hwChangeFlag;
hwChangeFlag =
(*target)->getAttr<ATTR_HWAS_STATE_CHANGED_FLAG>();

if(HWAS_CHANGED_BIT_MEMDIAG & hwChangeFlag)
{
MDIA_FAST(FUNC "hwChangedState is not cleared "
"for dimm: %x", get_huid(*target));
centaur = NULL; // don't add centaur and mcs and mba
break;
}
}
}
}
}

if(NULL == centaur)
{
break;
}
if(NULL == centaur)
{
break;
}

o_list.push_back(centaur);
o_list.push_back(centaur);

// get connected mcs target
targetList.clear();
// get connected mcs target
targetList.clear();

getParentAffinityTargets(targetList,
centaur,
CLASS_UNIT,
TYPE_MCS);
getParentAffinityTargets(targetList,
centaur,
CLASS_UNIT,
TYPE_MCS);

if( !targetList.empty() )
{
o_list.push_back(targetList[0]);
}

// add associated MBAs
targetList.clear();

getChildAffinityTargets(targetList, i_trgt, CLASS_UNIT, TYPE_MBA);

if ( !targetList.empty() )
{
o_list.insert( o_list.end(), targetList.begin(),
targetList.end() );
}

if( ! targetList.empty() )
{
o_list.push_back(targetList[0]);
}

} while(0);

MDIA_DBG(FUNC "mba: %x, size: %d",
MDIA_DBG(FUNC "i_trgt HUID: %x, size: %d",
get_huid(i_trgt), o_list.size());

return o_list;
Expand Down

0 comments on commit c0a19dc

Please sign in to comment.