summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C')
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C61
1 files changed, 38 insertions, 23 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C b/src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C
index 63143c0bb..f79bae5fe 100644
--- a/src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C
+++ b/src/usr/diag/prdf/plat/mem/prdfMemDynDealloc.C
@@ -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
OpenPOWER on IntegriCloud