From eb9479855310fb1897fd14294cbdfc9564bf3605 Mon Sep 17 00:00:00 2001 From: Zane Shelley Date: Sat, 14 Apr 2018 22:24:26 -0500 Subject: 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 Reviewed-by: Matt Derksen Tested-by: Jenkins Server Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/57477 CI-Ready: Zane C. Shelley Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins --- src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H | 44 +++++++++++--------------- src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C | 16 ---------- src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C | 8 ++--- src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C | 8 +++-- src/usr/diag/prdf/plat/mem/prdfP9Mca.C | 8 ++--- 5 files changed, 28 insertions(+), 56 deletions(-) (limited to 'src/usr/diag/prdf/plat') diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H index 3f3f354fc..06d4bef58 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr.H @@ -79,40 +79,32 @@ class MemTdCtlr */ uint32_t handleCmdComplete( STEP_CODE_DATA_STRUCT & io_sc ); + /** + * @brief This only pushes a new TdEntry to the back of iv_queue. + * @post Fetch attentions must also call handleTdEvent() to trigger + * diagnostics, if not already in progress. + * @param i_entry The new TD queue entry. + */ + void pushToQueue( TdEntry * i_entry ) { iv_queue.push(i_entry); } + + #ifdef __HOSTBOOT_RUNTIME /** - * @brief Adds a new TD procedure to the queue. - * - * During runtime, this is used to process TD requests during analysis of - * attentions other than the command complete attention (i.e. memory CEs - * and UEs). If there isn't a current TD procedure in progress, this - * function will stop background scrubbing and start this new procedure. - * Otherwise, this new procedure is simply added to the queue. - * - * It is possible that some of the other attentions may occur during the IPL - * after Hostboot has been flushed from the cache to system memory. At that - * point we don't have time to complete a TD procedure. Therefore, the - * requests will be ignored. Any chip marks placed during this time will be - * redetected when the runtime TD controller is initialized. + * @brief This tells the TD controller there was a TdEntry added to the + * queue (via pushToQueue) because of a fetch attention and + * additional processing may be needed to start the next TD + * procedure. If there isn't a current TD procedure in progress, + * this function will stop background scrubbing and starts the first + * procedure in the queue. * - * During MemDiags, this will simply add a new procedure to the queue, since - * we know a TD procedure will already be in progress when this is called. + * @pre A TdEntry must be added to the queue (via pushToQueue) before + * calling this function. * * @note Initializes the TD controller, if needed. * @param io_sc The step code data struct. - * @param i_entry The new TD queue entry. * @return Non-SUCCESS if an internal function fails, SUCCESS otherwise. */ - uint32_t handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, - TdEntry * i_entry ); - - /** - * @brief Pushes a new TdEntry to the back of iv_queue. - * @param i_entry The new TD queue entry. - */ - void pushToQueue( TdEntry * i_entry ) { iv_queue.push(i_entry); } - - #ifdef __HOSTBOOT_RUNTIME + uint32_t handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc ); /** * @brief Handles reset-reload or FO scenario. diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C index 7caba811b..1d25a9ecd 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_ipl.C @@ -48,22 +48,6 @@ using namespace PlatServices; //------------------------------------------------------------------------------ -template -uint32_t MemTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, - TdEntry * i_entry ) -{ - #define PRDF_FUNC "[MemTdCtlr::handleTdEvent] " - - // Add this entry to the queue. - iv_queue.push( i_entry ); - - return SUCCESS; - - #undef PRDF_FUNC -} - -//------------------------------------------------------------------------------ - template uint32_t MemTdCtlr::initialize() { diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C index f3693355e..a028f5b86 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTdCtlr_rt.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -164,8 +164,7 @@ void __recaptureRegs( STEP_CODE_DATA_STRUCT & io_sc, //------------------------------------------------------------------------------ template -uint32_t MemTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, - TdEntry * i_entry ) +uint32_t MemTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc ) { #define PRDF_FUNC "[MemTdCtlr::handleTdEvent] " @@ -182,9 +181,6 @@ uint32_t MemTdCtlr::handleTdEvent( STEP_CODE_DATA_STRUCT & io_sc, break; } - // Add this entry to the queue. - iv_queue.push( i_entry ); - // Don't interrupt a TD procedure if one is already in progress. if ( nullptr != iv_curProcedure ) break; diff --git a/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C b/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C index da993d51e..993216f9f 100644 --- a/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C +++ b/src/usr/diag/prdf/plat/mem/prdfMemTps_ipl.C @@ -26,6 +26,7 @@ /** @file prdfMemTps_ipl.C */ // Platform includes +#include #include #include #include @@ -157,9 +158,10 @@ uint32_t TpsEvent::nextStep( STEP_CODE_DATA_STRUCT & io_sc, chipMark.getSymbol() ); io_sc.service_data->SetCallout( memmru ); - //Add a VCM procedure to the queue - MemEcc::addVcmEvent(iv_chip, iv_rank, - chipMark, io_sc); + // Add a VCM procedure to the queue. + TdEntry * entry = new VcmEvent { iv_chip, iv_rank, + chipMark }; + MemDbUtils::pushToQueue( iv_chip, entry ); //Abort this procedure o_done = true; diff --git a/src/usr/diag/prdf/plat/mem/prdfP9Mca.C b/src/usr/diag/prdf/plat/mem/prdfP9Mca.C index a08385e5c..7a5d10d64 100644 --- a/src/usr/diag/prdf/plat/mem/prdfP9Mca.C +++ b/src/usr/diag/prdf/plat/mem/prdfP9Mca.C @@ -29,15 +29,14 @@ #include // Platform includes +#include #include -#include #include #include #ifdef __HOSTBOOT_RUNTIME #include #endif - using namespace TARGETING; namespace PRDF @@ -150,8 +149,6 @@ int32_t RcdParityError( ExtensibleChip * i_mcaChip, { io_sc.service_data->setServiceCall(); - McbistDataBundle * mcbdb = getMcbistDataBundle( mcbChip ); - std::vector list; getSlaveRanks( i_mcaChip->getTrgt(), list ); PRDF_ASSERT( !list.empty() ); // target configured with no ranks @@ -159,7 +156,8 @@ int32_t RcdParityError( ExtensibleChip * i_mcaChip, for ( auto & r : list ) { TdEntry * entry = new TpsEvent( i_mcaChip, r ); - uint32_t rc = mcbdb->getTdCtlr()->handleTdEvent( io_sc, entry ); + MemDbUtils::pushToQueue( i_mcaChip, entry ); + uint32_t rc = MemDbUtils::handleTdEvent(i_mcaChip, io_sc); if ( SUCCESS != rc ) { PRDF_ERR( PRDF_FUNC "handleTdEvent() failed on 0x%08x", -- cgit v1.2.1