Skip to content

Commit

Permalink
PRD: getConnectedParent() issue in MemDealloc::dimmList()
Browse files Browse the repository at this point in the history
Change-Id: Iead98b6d1a67bf83639f085b952359e9a5908899
CQ: SW418940
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54793
Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@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/55005
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 Mar 3, 2018
1 parent 9aa0464 commit 9abf4f3
Showing 1 changed file with 38 additions and 23 deletions.
61 changes: 38 additions & 23 deletions src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C
Original file line number Diff line number Diff line change
Expand Up @@ -662,32 +662,47 @@ int32_t dimmList( TargetHandleList & i_dimmList )

int32_t dimmList( TargetHandleList & i_dimmList )
{
if (i_dimmList.size() == 0)
return SUCCESS;

// Determine MBA/MCA
TYPE T = TYPE_MCA;
TargetHandle_t dimmTgt = i_dimmList[0];
TargetHandle_t tgt = getConnectedParent( dimmTgt, T );
if ( NULL == tgt)
{
T = TYPE_MBA;
tgt = getConnectedParent( dimmTgt, T );
}
#define PRDF_FUNC "[MemDealloc::dimmList] "

if (tgt == NULL)
int32_t o_rc = SUCCESS;

do
{
PRDF_ERR( "[MemDealloc::dimmList] get parent tgt failed for 0x%08X",
getHuid(dimmTgt));
return FAIL;
}
if ( i_dimmList.empty() ) break;

// Determine what target these DIMMs are connected to.
// Note that we cannot use getConnectedParent() because it will assert
// if there is no parent of that type.

TargetHandle_t dimmTrgt = i_dimmList.front();
TargetHandleList list;

// First, check for MCAs.
list = getConnected( dimmTrgt, TYPE_MCA );
if ( !list.empty() )
{
o_rc = dimmList<TYPE_MCA>( i_dimmList );
break;
}

// Second, check for MBAs.
list = getConnected( dimmTrgt, TYPE_MBA );
if ( !list.empty() )
{
o_rc = dimmList<TYPE_MBA>( i_dimmList );
break;
}

if ( T == TYPE_MCA )
return dimmList<TYPE_MCA>( i_dimmList );
else if ( T == TYPE_MBA )
return dimmList<TYPE_MBA>( i_dimmList );
else
return FAIL;
// If we get here we did not find a supported target.
PRDF_ERR( PRDF_FUNC "Unsupported connected parent to dimm 0x%08x",
getHuid(dimmTrgt) );
PRDF_ASSERT(false); // code bug

} while (0);

return o_rc;

#undef PRDF_FUNC
}

} //namespace MemDealloc
Expand Down

0 comments on commit 9abf4f3

Please sign in to comment.