diff options
author | Prem Shanker Jha <premjha2@in.ibm.com> | 2013-03-19 06:46:57 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-04-02 17:35:08 -0500 |
commit | 9ddf767f5c8a2289c4211391cf4c69ac2546f672 (patch) | |
tree | cc11fb28e84e585c089ef2719c69626d9a28c073 /src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C | |
parent | d3dd93c04ac775170ea0c129ca06c0be521c8947 (diff) | |
download | talos-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/prdf/common/plat/pegasus/prdfPegasusConfigurator.C')
-rw-r--r-- | src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C | 27 |
1 files changed, 20 insertions, 7 deletions
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 ); |