summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/plat
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/diag/prdf/common/plat')
-rw-r--r--src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C3
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/mem/prdfMemoryMru.C25
-rw-r--r--src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C9
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.C51
-rwxr-xr-xsrc/usr/diag/prdf/common/plat/prdfTargetServices.H4
5 files changed, 19 insertions, 73 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
index 8e809c4ca..3c6b757fb 100644
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -64,7 +64,6 @@ uint32_t __addVcmEvent<TYPE_MCA>( ExtensibleChip * i_chip,
PRDF_ASSERT( TYPE_MCA == i_chip->getType() );
ExtensibleChip * mcbChip = getConnectedParent( i_chip, TYPE_MCBIST );
- PRDF_ASSERT( nullptr != mcbChip ); // definitely a bug
McbistDataBundle * mcbdb = getMcbistDataBundle( mcbChip );
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemoryMru.C b/src/usr/diag/prdf/common/plat/mem/prdfMemoryMru.C
index 3acf6e233..2441d4b95 100755
--- a/src/usr/diag/prdf/common/plat/mem/prdfMemoryMru.C
+++ b/src/usr/diag/prdf/common/plat/mem/prdfMemoryMru.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2016 */
+/* Contributors Listed Below - COPYRIGHT 2013,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -293,33 +293,14 @@ void MemoryMru::getCommonVars()
PRDF_ASSERT( TYPE_MCA == trgtType || TYPE_MBA == trgtType );
TargetHandle_t proc = getConnectedParent( iv_target, TYPE_PROC );
- if ( NULL == proc )
- {
- PRDF_ERR( PRDF_FUNC "Could not find proc attached to target 0x%08x",
- getHuid(iv_target) );
- PRDF_ASSERT( false );
- }
-
TargetHandle_t node = getConnectedParent( proc, TYPE_NODE );
- if ( NULL == node )
- {
- PRDF_ERR( PRDF_FUNC "Could not find node attached to target 0x%08x",
- getHuid(proc) );
- PRDF_ASSERT( false );
- }
// If our target is an MBA, get the chnlPos from the membuf and the
// mbaPos from the target
if ( TYPE_MBA == getTargetType(iv_target) )
{
- TargetHandle_t membuf = getConnectedParent( iv_target,
- TYPE_MEMBUF );
- if ( NULL == membuf )
- {
- PRDF_ERR( PRDF_FUNC "Could not find membuf attached to 0x%08x",
- getHuid(iv_target) );
- PRDF_ASSERT( false );
- }
+ TargetHandle_t membuf = getConnectedParent( iv_target, TYPE_MEMBUF );
+
iv_memMruMeld.s.isMca = 0;
iv_memMruMeld.s.chnlPos = getTargetPosition( membuf );
iv_memMruMeld.s.mbaPos = getTargetPosition( iv_target );
diff --git a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C
index daaa33836..23ea0fade 100644
--- a/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C
+++ b/src/usr/diag/prdf/common/plat/p9/prdfP9ProcDomain.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -146,13 +146,6 @@ void ProcDomain::SortForXstop()
TargetHandle_t proc = sysDebug.getTargetWithAttn( TYPE_PROC,
MACHINE_CHECK);
node = getConnectedParent( proc, TYPE_NODE);
- if( NULL == node )
- {
- // We should never reach here. Even if we reach here, as this is
- // XSTOP, we would like to go ahead with analysis to have as much
- // data as possible. So just print a trace.
- PRDF_ERR("[ProcDomain::SortForXstop] Node is Null");
- }
}
// Get internal setting and external driver list for each chip.
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.C b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
index f08276ecd..c7459e20a 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.C
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.C
@@ -624,8 +624,6 @@ TargetHandle_t getConnectedParent( TargetHandle_t i_target, TYPE i_connType )
PRDF_ASSERT( nullptr != i_target );
- TargetHandle_t o_parent = NULL;
-
// Get the association type, must be PARENT_BY_AFFINITY.
TargetService::ASSOCIATION_TYPE assocType = getAssociationType( i_target,
i_connType);
@@ -636,21 +634,16 @@ TargetHandle_t getConnectedParent( TargetHandle_t i_target, TYPE i_connType )
PRDF_ASSERT(false);
}
- do
+ // Get the connected parent, should be one and only one parent
+ TargetHandleList list = getConnAssoc( i_target, i_connType, assocType );
+ if ( 1 != list.size() || nullptr == list[0] )
{
- TargetHandleList list = getConnAssoc( i_target, i_connType, assocType );
- if ( 1 != list.size() ) // Should be one and only one parent
- {
- PRDF_ERR( PRDF_FUNC "Could not find parent: i_target=0x%08x "
- "i_connType=%d", getHuid(i_target), i_connType );
- break;
- }
-
- o_parent = list[0];
-
- } while(0);
+ PRDF_ERR( PRDF_FUNC "Could not find parent: i_target=0x%08x "
+ "i_connType=%d", getHuid(i_target), i_connType );
+ PRDF_ASSERT(false);
+ }
- return o_parent;
+ return list[0];
#undef PRDF_FUNC
}
@@ -849,16 +842,10 @@ ExtensibleChip * getConnectedParent( ExtensibleChip * i_child,
{
PRDF_ASSERT( nullptr != i_child );
- ExtensibleChip * o_parent = nullptr;
-
TargetHandle_t trgt = getConnectedParent( i_child->getTrgt(),
i_parentType );
- if ( nullptr != trgt )
- {
- o_parent = (ExtensibleChip *)systemPtr->GetChip( trgt );
- }
- return o_parent;
+ return (ExtensibleChip *)systemPtr->GetChip( trgt );
}
//------------------------------------------------------------------------------
@@ -1192,18 +1179,9 @@ uint32_t getMemChnl( TARGETING::TargetHandle_t i_memTarget )
// INVALID_POSITION_BOUND for call
// from getTargetPosition().
- do
- {
- TargetHandle_t mcsTarget = getConnectedParent( i_memTarget, TYPE_MCS );
- if ( NULL == mcsTarget )
- {
- PRDF_ERR( PRDF_FUNC "getConnectedParent() failed" );
- break;
- }
-
- o_chnl = getTargetPosition( mcsTarget );
+ TargetHandle_t mcsTarget = getConnectedParent( i_memTarget, TYPE_MCS );
- } while (0);
+ o_chnl = getTargetPosition( mcsTarget );
if ( MAX_MCS_PER_PROC <= o_chnl ) // Real MCS position check.
{
@@ -1597,13 +1575,6 @@ TARGETING::TargetHandle_t getClockId(TARGETING::TargetHandle_t
if(TYPE_MEMBUF == getTargetType(i_pGivenTarget))
{
l_target = getConnectedParent(i_pGivenTarget, TYPE_PROC);
- if(NULL == l_target)
- {
- PRDF_ERR(PRDF_FUNC "failed to get proc target "
- "connected to membuf 0x%.8X",
- getHuid(l_target));
- break;
- }
}
PredicateIsFunctional l_funcFilter;
diff --git a/src/usr/diag/prdf/common/plat/prdfTargetServices.H b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
index 62d487c3b..60b930136 100755
--- a/src/usr/diag/prdf/common/plat/prdfTargetServices.H
+++ b/src/usr/diag/prdf/common/plat/prdfTargetServices.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -183,6 +183,7 @@ TARGETING::TargetHandleList getConnected( TARGETING::TargetHandle_t i_target,
* @param i_connType Type of target(s) return in list
* @note If the given target is the same type as the given type, the given
* target is returned.
+ * @note This function will assert if no valid parent is found.
* @return The requested parent target, NULL if something failed.
*/
TARGETING::TargetHandle_t getConnectedParent(TARGETING::TargetHandle_t i_target,
@@ -217,6 +218,7 @@ ExtensibleChipList getConnected( ExtensibleChip * i_chip,
* @param i_parentType The targeting type of the parent.
* @note If the child is the same type as the parent type, the child is
* returned.
+ * @note This function will assert if no valid parent is found.
* @return The connected parent, nullptr if not found.
*/
ExtensibleChip * getConnectedParent( ExtensibleChip * i_child,
OpenPOWER on IntegriCloud