Skip to content

Commit

Permalink
PRD: Skip callouts without trgts when clearing NVDIMM gard
Browse files Browse the repository at this point in the history
Change-Id: Ic8dea5a3077a34ff10ade3c01f1a5031294156ef
CQ: SW473843
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82947
Reviewed-by: Paul Greenwood <paul.greenwood@ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian J Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C Shelley <zshelle@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82949
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>
  • Loading branch information
cnpalmer authored and zane131 committed Aug 29, 2019
1 parent 153dcaa commit 6034efa
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 11 deletions.
Expand Up @@ -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,
Expand All @@ -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
Expand Down
26 changes: 18 additions & 8 deletions src/usr/diag/prdf/common/plat/prdfRasServices_common.C
Expand Up @@ -891,21 +891,21 @@ 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() )
{
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 );
Expand Down Expand Up @@ -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);
}
}
}
}
Expand Down

0 comments on commit 6034efa

Please sign in to comment.