From 6034efa847e5bb46288670c12fc5fb02f6390aab Mon Sep 17 00:00:00 2001 From: Caleb Palmer Date: Tue, 27 Aug 2019 14:59:06 -0500 Subject: PRD: Skip callouts without trgts when clearing NVDIMM gard Change-Id: Ic8dea5a3077a34ff10ade3c01f1a5031294156ef CQ: SW473843 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82947 Reviewed-by: Paul Greenwood Tested-by: Jenkins Server Reviewed-by: Brian J Stegmiller Reviewed-by: Zane C Shelley Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82949 Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins --- .../framework/service/prdfServiceDataCollector.C | 39 ++++++++++++++++++++-- .../diag/prdf/common/plat/prdfRasServices_common.C | 26 ++++++++++----- 2 files changed, 54 insertions(+), 11 deletions(-) (limited to 'src/usr/diag/prdf') diff --git a/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C b/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C index 49ba0bf7e..11f264a49 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C +++ b/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C @@ -187,13 +187,17 @@ void ServiceDataCollector::clearNvdimmMruListGard() for ( auto & mru : xMruList ) { PRDcallout callout = mru.callout; - TargetHandle_t trgt = callout.getTarget(); - if ( TYPE_DIMM == PlatServices::getTargetType(trgt) ) + PRDcalloutData::MruType mruType = callout.getType(); + + if ( mruType == PRDcalloutData::TYPE_TARGET ) { + TargetHandle_t trgt = callout.getTarget(); + // If the callout target is an NVDIMM send a message to // PHYP/Hostboot that a save/restore may work, and if we are at // IPL, clear Gard on the NVDIMM. - if ( isNVDIMM(trgt) ) + if ( TYPE_DIMM == PlatServices::getTargetType(trgt) && + isNVDIMM(trgt) ) { // Send the message to PHYP/Hostboot uint32_t l_rc = PlatServices::nvdimmNotifyProtChange( trgt, @@ -210,6 +214,35 @@ void ServiceDataCollector::clearNvdimmMruListGard() #endif } } + else if ( mruType == PRDcalloutData::TYPE_MEMMRU ) + { + MemoryMru memMru( callout.flatten() ); + TargetHandleList dimmList = memMru.getCalloutList(); + + for ( auto & dimm : dimmList ) + { + // If the callout target is an NVDIMM send a message to + // PHYP/Hostboot that a save/restore may work, and if we are at + // IPL, clear Gard on the NVDIMM. + if ( TYPE_DIMM == PlatServices::getTargetType(dimm) && + isNVDIMM(dimm) ) + { + // Send the message to PHYP/Hostboot + uint32_t l_rc = PlatServices::nvdimmNotifyProtChange( dimm, + NVDIMM::NVDIMM_RISKY_HW_ERROR ); + if ( SUCCESS != l_rc ) + { + PRDF_TRAC( PRDF_FUNC "nvdimmNotifyProtChange(0x%08x) " + "failed.", PlatServices::getHuid(dimm) ); + continue; + } + #ifndef __HOSTBOOT_RUNTIME + // IPL, clear Gard + mru.gardState = NO_GARD; + #endif + } + } + } } #endif // __HOSTBOOT_MODULE #endif // CONFIG_NVDIMM diff --git a/src/usr/diag/prdf/common/plat/prdfRasServices_common.C b/src/usr/diag/prdf/common/plat/prdfRasServices_common.C index d1119efdc..2742286b3 100755 --- a/src/usr/diag/prdf/common/plat/prdfRasServices_common.C +++ b/src/usr/diag/prdf/common/plat/prdfRasServices_common.C @@ -891,14 +891,6 @@ void ErrDataService::deallocateDimms( const SDC_MRU_LIST & i_mruList ) for ( SDC_MRU_LIST::const_iterator it = i_mruList.begin(); it != i_mruList.end(); ++it ) { - #ifdef CONFIG_NVDIMM - // If the MRU's gard policy is set to NO_GARD, skip it. - if ( NO_GARD == it->gardState && - isNVDIMM(it->callout.getTarget()) ) - { - continue; - } - #endif PRDcallout thiscallout = it->callout; if ( PRDcalloutData::TYPE_TARGET == thiscallout.getType() ) @@ -906,6 +898,14 @@ void ErrDataService::deallocateDimms( const SDC_MRU_LIST & i_mruList ) TargetHandle_t calloutTgt = thiscallout.getTarget(); TYPE tgtType = getTargetType( calloutTgt ); + #ifdef CONFIG_NVDIMM + // If the MRU's gard policy is set to NO_GARD, skip it. + if ( NO_GARD == it->gardState && isNVDIMM(calloutTgt) ) + { + continue; + } + #endif + if ( TYPE_L4 == tgtType ) { calloutTgt = getConnectedParent( calloutTgt, TYPE_MEMBUF ); @@ -941,7 +941,17 @@ void ErrDataService::deallocateDimms( const SDC_MRU_LIST & i_mruList ) dimm != dimms.end(); ++dimm ) { if ( TYPE_DIMM == getTargetType(*dimm) ) + { + #ifdef CONFIG_NVDIMM + // If the MRU's gard policy is set to NO_GARD, skip it. + if ( NO_GARD == it->gardState && isNVDIMM(*dimm) ) + { + continue; + } + #endif + dimmList.push_back(*dimm); + } } } } -- cgit v1.2.1