summaryrefslogtreecommitdiffstats
path: root/src/usr/diag
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2013-03-19 06:46:57 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-02 17:35:08 -0500
commit9ddf767f5c8a2289c4211391cf4c69ac2546f672 (patch)
treecc11fb28e84e585c089ef2719c69626d9a28c073 /src/usr/diag
parentd3dd93c04ac775170ea0c129ca06c0be521c8947 (diff)
downloadtalos-hostboot-9ddf767f5c8a2289c4211391cf4c69ac2546f672.tar.gz
talos-hostboot-9ddf767f5c8a2289c4211391cf4c69ac2546f672.zip
PRDF::Addresed error paths in pegasus configurator.
Change-Id: I9fcb69af0ee8627876aa5035b888a3ad55668eec RTC: 66666 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3624 Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Tested-by: Jenkins Server Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3830 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag')
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/register/prdfScanFacility.C1
-rw-r--r--src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C27
-rwxr-xr-xsrc/usr/diag/prdf/common/prdfMain_common.C15
3 files changed, 29 insertions, 14 deletions
diff --git a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C
index 9a2146988..e8e35ab68 100755
--- a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C
+++ b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C
@@ -178,7 +178,6 @@ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetPluginRegister(
//-----------------------------------------------------------------------------
void ScanFacility::ResetPluginRegister()
{
- PRDF_INF( "ScanFacility.ResetPluginRegister()" );
iv_pluginRegFw.clear();
diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C
index 7006c7729..7616b4933 100644
--- a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C
+++ b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C
@@ -112,13 +112,16 @@ errlHndl_t PegasusConfigurator::build()
MbaDomain * l_mbaDomain = new MbaDomain( MBA_DOMAIN );
uint32_t l_maxNodeCount = _getMaxNumNodes();
-
// PLL domains
PllDomainList l_fabricPllDomains(l_maxNodeCount, NULL);
PllDomainList l_membPllDomains( l_maxNodeCount, NULL);
do
{
+ // Idea of build is to add chips to domain and add domains to System
+ // Also, we should ensure that if build fails in mid way, deleting
+ // System should be enough to clean up th partial model.
+
// Add chips to domains.
errl = addDomainChips( TYPE_PROC, l_procDomain, &l_fabricPllDomains );
if ( NULL != errl ) break;
@@ -135,16 +138,25 @@ errlHndl_t PegasusConfigurator::build()
errl = addDomainChips( TYPE_MBA, l_mbaDomain );
if ( NULL != errl ) break;
- // Add Pll domains to domain list.
- addPllDomainsToSystem( l_fabricPllDomains, l_membPllDomains );
+ } while (0);
+
+ //Note: we are adding these domains to system regardles of error log
+ //handle status. We are doing it simply because in case error handle is
+ //not NULL, we want to clean up the partial object model by simply
+ //deleting the system. If we add domain to system with or without chips
+ //( error scenario ), we can do the clean up quite easily.
// Add domains to domain list. NOTE: Order is important because this is
// the order the domains will be analyzed.
+
+ addPllDomainsToSystem( l_fabricPllDomains, l_membPllDomains );
+
+ //Proc domain added after PLL domain
sysDmnLst.push_back( l_procDomain );
- sysDmnLst.push_back( l_exDomain );
- sysDmnLst.push_back( l_mcsDomain );
+ sysDmnLst.push_back( l_exDomain );
+ sysDmnLst.push_back( l_mcsDomain );
sysDmnLst.push_back( l_membufDomain );
- sysDmnLst.push_back( l_mbaDomain );
+ sysDmnLst.push_back( l_mbaDomain );
// Add chips to the system.
Configurator::chipList & chips = getChipList();
@@ -173,7 +185,6 @@ errlHndl_t PegasusConfigurator::build()
chips.clear();
domains.clear();
- } while (0);
if ( NULL != errl )
{
@@ -236,7 +247,9 @@ errlHndl_t PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type,
scanFac, resFac,l_errl );
if( NULL != l_errl )
{
+ delete chip;
break;
+
}
sysChipLst.push_back( chip );
io_domain->AddChip( chip );
diff --git a/src/usr/diag/prdf/common/prdfMain_common.C b/src/usr/diag/prdf/common/prdfMain_common.C
index 00d917363..df9f53da9 100755
--- a/src/usr/diag/prdf/common/prdfMain_common.C
+++ b/src/usr/diag/prdf/common/prdfMain_common.C
@@ -158,18 +158,21 @@ errlHndl_t initialize()
{
//there is some problem in building RuleMetaData object
g_prd_errlHndl = l_errBuild;
+
+ //object model is either not build or at best incomplete.We must
+ // clean this up .The easiest way is to delete the system which in
+ //in turn shall clean up the constituents.
+ delete systemPtr;
+ systemPtr = NULL;
+ g_initialized = false;
+ PRDF_ERR("PRDF::initialize() failed to buid object model");
}
//systemPtr is populated in configurator
- if(systemPtr != NULL)
+ else if( systemPtr != NULL )
{
systemPtr->Initialize(); // Hardware initialization
g_initialized = true;
}
- else // something bad happend.
- {
- PRDF_ERR("PRDF::initialize() failed to buid object model");
- g_initialized = false;
- }
// Flush rule table cache since objects are all built.
Prdr::LoadChipCache::flushCache();
OpenPOWER on IntegriCloud