diff options
author | Zane Shelley <zshelle@us.ibm.com> | 2018-04-14 22:24:26 -0500 |
---|---|---|
committer | Zane C. Shelley <zshelle@us.ibm.com> | 2018-04-19 16:45:37 -0400 |
commit | eb9479855310fb1897fd14294cbdfc9564bf3605 (patch) | |
tree | 6348365d6ad43dd3d30eaed82c10c2e51cdba836 /src/usr/diag/prdf/common/plat/mem | |
parent | 81c7d1cc28c7dc7a6b208165031aeab1f459fcbc (diff) | |
download | talos-hostboot-eb9479855310fb1897fd14294cbdfc9564bf3605.tar.gz talos-hostboot-eb9479855310fb1897fd14294cbdfc9564bf3605.zip |
PRD: Simplified use of pushToQueue() and handleTdEvent()
Change-Id: Iaaa137886feb30d034360e8a16a74e98b0aaece3
RTC: 188516
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57234
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57477
CI-Ready: Zane C. Shelley <zshelle@us.ibm.com>
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>
Diffstat (limited to 'src/usr/diag/prdf/common/plat/mem')
-rw-r--r-- | src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H | 106 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C | 125 | ||||
-rw-r--r-- | src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H | 11 |
3 files changed, 143 insertions, 99 deletions
diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H b/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H new file mode 100644 index 000000000..46d3a7a66 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H @@ -0,0 +1,106 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/mem/prdfMemDbUtils.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +#ifndef prdfMemDbUtils_H +#define prdfMemDbUtils_H + +#include <prdfCenMbaDataBundle.H> +#include <prdfP9McaDataBundle.H> + +namespace PRDF +{ + +namespace MemDbUtils +{ + +//############################################################################## +// Hostboot IPL/Runtime wrappers +//############################################################################## + +#ifdef __HOSTBOOT_MODULE + +/** + * @brief Generic wrapper to push a TdEntry to the Targeted Diagnostics queue. + * @param i_chip MCA or MBA. + * @param i_entry The new TdEntry. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +template<TARGETING::TYPE T> +void pushToQueue( ExtensibleChip * i_chip, TdEntry * i_entry ); + +template<> inline +void pushToQueue<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip, + TdEntry * i_entry ) +{ + getMcaDataBundle(i_chip)->getTdCtlr()->pushToQueue( i_entry ); +} + +template<> inline +void pushToQueue<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip, + TdEntry * i_entry ) +{ + getMbaDataBundle(i_chip)->getTdCtlr()->pushToQueue( i_entry ); +} + +#endif // Hostboot IPL/Runtime + +//############################################################################## +// Hostboot Runtime only wrappers +//############################################################################## + +#if defined(__HOSTBOOT_MODULE) && defined(__HOSTBOOT_RUNTIME) + +/** + * @brief Generic wrapper to tell the TD controller to process the next event + * in the TD queue. + * @param i_chip MCA or MBA. + * @param io_sc The step code data struct. + * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. + */ +template<TARGETING::TYPE T> +uint32_t handleTdEvent( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ); + +template<> inline +uint32_t handleTdEvent<TARGETING::TYPE_MCA>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + return getMcaDataBundle(i_chip)->getTdCtlr()->handleTdEvent( io_sc ); +} + +template<> inline +uint32_t handleTdEvent<TARGETING::TYPE_MBA>( ExtensibleChip * i_chip, + STEP_CODE_DATA_STRUCT & io_sc ) +{ + return getMbaDataBundle(i_chip)->getTdCtlr()->handleTdEvent( io_sc ); +} + +#endif // Hostboot Runtime only + +} // end namespace MemDbUtils + +} // end namespace PRDF + +#endif // prdfMemDbUtils_H diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C index 89a9a8b15..8f6b2a875 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.C @@ -26,11 +26,10 @@ #include <prdfMemEccAnalysis.H> // Platform includes -#include <prdfCenMbaDataBundle.H> #include <prdfMemAddress.H> #include <prdfMemCaptureData.H> +#include <prdfMemDbUtils.H> #include <prdfMemDqBitmap.H> -#include <prdfP9McaDataBundle.H> #include <prdfP9McaExtraSig.H> #include <prdfPlatServices.H> @@ -393,68 +392,6 @@ bool queryIueTh<TYPE_MCA>( ExtensibleChip * i_chip, //------------------------------------------------------------------------------ -#ifdef __HOSTBOOT_MODULE - -template<TARGETING::TYPE T, typename D> -uint32_t addVcmEvent( ExtensibleChip * i_chip, const MemRank & i_rank, - const MemMark & i_mark, STEP_CODE_DATA_STRUCT & io_sc, - bool i_isFetch ) -{ - PRDF_ASSERT( T == i_chip->getType() ); - - uint32_t o_rc = SUCCESS; - - D db = static_cast<D>(i_chip->getDataBundle()); - - TdEntry * entry = new VcmEvent<T>( i_chip, i_rank, i_mark ); - - // We only want to call handleTdEvent for fetch attentions, if we do it in - // other cases we will hit an infinite loop, so we just add the entry to the - // queue instead. - if ( i_isFetch ) - o_rc = db->getTdCtlr()->handleTdEvent( io_sc, entry ); - else - db->getTdCtlr()->pushToQueue( entry ); - - return o_rc; -} - -template -uint32_t addVcmEvent<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip, - const MemRank & i_rank, - const MemMark & i_mark, - STEP_CODE_DATA_STRUCT & io_sc, - bool i_isFetch); - -#endif - -//------------------------------------------------------------------------------ - -#ifdef __HOSTBOOT_MODULE - -template<TARGETING::TYPE T, typename D> -uint32_t addTpsEvent( ExtensibleChip * i_chip, const MemRank & i_rank, - STEP_CODE_DATA_STRUCT & io_sc, bool i_banTps ) -{ - PRDF_ASSERT( T == i_chip->getType() ); - - D db = static_cast<D>(i_chip->getDataBundle()); - - TdEntry * entry = new TpsEvent<T>( i_chip, i_rank, i_banTps ); - - return db->getTdCtlr()->handleTdEvent( io_sc, entry ); -} - -template -uint32_t addTpsEvent<TYPE_MCA, McaDataBundle *>( ExtensibleChip * i_chip, - const MemRank & i_rank, - STEP_CODE_DATA_STRUCT & io_sc, - bool i_banTps ); - -#endif - -//------------------------------------------------------------------------------ - template<TARGETING::TYPE T, typename D> uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank, STEP_CODE_DATA_STRUCT & io_sc, bool i_isFetch ) @@ -487,29 +424,22 @@ uint32_t handleMpe( ExtensibleChip * i_chip, const MemRank & i_rank, io_sc.service_data->SetCallout( mm ); // Add a VCM request to the TD queue if at runtime or at memdiags. - #ifdef __HOSTBOOT_RUNTIME - o_rc = addVcmEvent<T,D>( i_chip, i_rank, chipMark, io_sc, i_isFetch ); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "addVcmEvent() failed: i_chip=0x%08x " - "i_rank=m%ds%d", i_chip->getHuid(), i_rank.getMaster(), - i_rank.getSlave() ); - break; - } - #elif defined(__HOSTBOOT_MODULE) && !defined(__HOSTBOOT_RUNTIME) + #ifdef __HOSTBOOT_MODULE + + #ifndef __HOSTBOOT_RUNTIME if ( isInMdiaMode() ) { - o_rc = addVcmEvent<T,D>(i_chip, i_rank, chipMark, io_sc, i_isFetch); - if ( SUCCESS != o_rc ) - { - PRDF_ERR( PRDF_FUNC "addVcmEvent() failed: i_chip=0x%08x " - "i_rank=m%ds%d", i_chip->getHuid(), i_rank.getMaster(), - i_rank.getSlave() ); - break; - } + #endif + + TdEntry * entry = new VcmEvent<T>( i_chip, i_rank, chipMark ); + MemDbUtils::pushToQueue<T>( i_chip, entry ); + + #ifndef __HOSTBOOT_RUNTIME } #endif + #endif + }while(0); return o_rc; @@ -569,6 +499,7 @@ uint32_t analyzeFetchMpe( ExtensibleChip * i_chip, const MemRank & i_rank, D db = static_cast<D>(i_chip->getDataBundle()); db->iv_ueTable.addEntry( UE_TABLE::FETCH_MPE, addr ); + // Get callouts, etc., and add the chip mark to the queue. o_rc = MemEcc::handleMpe<T,D>( i_chip, i_rank, io_sc, true ); if ( SUCCESS != o_rc ) { @@ -577,6 +508,20 @@ uint32_t analyzeFetchMpe( ExtensibleChip * i_chip, const MemRank & i_rank, break; } + #ifdef __HOSTBOOT_RUNTIME + + // The chip mark has already been added to the queue. Now tell the TD + // controller to process it if not already in progress. + o_rc = MemDbUtils::handleTdEvent<T>( i_chip, io_sc ); + if ( SUCCESS != o_rc ) + { + PRDF_ERR( PRDF_FUNC "handleTdEvent(0x%08x) failed on rank " + "0x%02x", i_chip->getHuid(), i_rank.getKey() ); + break; + } + + #endif + } while (0); // Add ECC capture data for FFDC. @@ -778,11 +723,13 @@ uint32_t analyzeFetchNceTce( ExtensibleChip * i_chip, // will still try to start TPS just in case MNFG disables the // termination policy. - o_rc = addTpsEvent<T,D>( i_chip, rank, io_sc ); + MemDbUtils::pushToQueue<T>( i_chip, new TpsEvent<T>(i_chip, rank) ); + o_rc = MemDbUtils::handleTdEvent<T>( i_chip, io_sc ); if ( SUCCESS != o_rc ) { - PRDF_ERR( PRDF_FUNC "addTpsEvent(0x%08x,0x%02x) failed", - i_chip->getHuid(), rank.getKey() ); + PRDF_ERR( PRDF_FUNC "handleTdEvent(0x%08x) failed on rank " + "0x%02x", i_chip->getHuid(), rank.getKey() ); + break; } #endif @@ -846,12 +793,12 @@ uint32_t analyzeFetchUe( ExtensibleChip * i_chip, // Add a TPS request to the TD queue and ban any further TPS requests // for this rank. MemRank rank = addr.getRank(); - o_rc = addTpsEvent<T,D>( i_chip, rank, io_sc, true ); + MemDbUtils::pushToQueue<T>(i_chip, new TpsEvent<T>(i_chip, rank, true)); + o_rc = MemDbUtils::handleTdEvent<T>( i_chip, io_sc ); if ( SUCCESS != o_rc ) { - PRDF_ERR( PRDF_FUNC "addTpsEvent() failed: i_chip=0x%08x " - "rank=%d,%d", i_chip->getHuid(), rank.getMaster(), - rank.getSlave() ); + PRDF_ERR( PRDF_FUNC "handleTdEvent(0x%08x) failed on rank 0x%02x", + i_chip->getHuid(), rank.getKey() ); break; } diff --git a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H index 5988e2478..1cc49b95a 100644 --- a/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H +++ b/src/usr/diag/prdf/common/plat/mem/prdfMemEccAnalysis.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -211,15 +211,6 @@ bool queryIueTh( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & io_sc ); template<TARGETING::TYPE T> uint32_t maskMemPort( ExtensibleChip * i_chip ); -template<TARGETING::TYPE T, typename D> -uint32_t addVcmEvent( ExtensibleChip * i_chip, const MemRank & i_rank, - const MemMark & i_mark, STEP_CODE_DATA_STRUCT & io_sc, - bool i_isFetch = false ); - -template<TARGETING::TYPE T, typename D> -uint32_t addTpsEvent( ExtensibleChip * i_chip, const MemRank & i_rank, - STEP_CODE_DATA_STRUCT & io_sc, bool i_banTps = false ); - #endif } // end namespace MemEcc |