Skip to content

Commit

Permalink
Invalidate BAR during MPIPL NVDIMM restore
Browse files Browse the repository at this point in the history
This is a preventive measure to avoid access from the proc to
step on the restore.

Change-Id: I8d190f1cf2d49663ee40caaae56cb3b63e7b5d0c
CQ:SW470208
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/80571
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@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>
Reviewed-by: Corey V Swenson <cswenson@us.ibm.com>
Reviewed-by: Daniel M Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Tsung Yeung authored and dcrowell77 committed Jul 24, 2019
1 parent 8cc600d commit d97b706
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/usr/isteps/nvdimm/nvdimm.C
Expand Up @@ -972,6 +972,7 @@ errlHndl_t nvdimmRestore(TargetHandleList i_nvdimmList, uint8_t &i_mpipl)
// is de-asserted before kicking off the restore
if (i_mpipl)
{
TRACFCOMP(g_trac_nvdimm, "nvdimmRestore(): in MPIPL");
FAPI_INVOKE_HWP(l_err, mss::ddr_resetn, l_fapi_mca, HIGH);

if (l_err)
Expand All @@ -987,6 +988,23 @@ errlHndl_t nvdimmRestore(TargetHandleList i_nvdimmList, uint8_t &i_mpipl)
// Leaving this comment here as a reminder, will remove later
break;
}

// In MPIPL, invalidate the BAR to prevent any traffic from stepping on
// the restore
FAPI_INVOKE_HWP(l_err, mss::nvdimm::change_bar_valid_state, l_fapi_mca, LOW);

// This should not fail at all (scom read/write). If it does, post an informational log
// to leave some breadcrumbs
if (l_err)
{
TRACFCOMP(g_trac_nvdimm, ERR_MRK"nvdimmRestore() HUID[%X] i_mpipl[%u] failed to invalidate BAR!",
get_huid(*it), i_mpipl);

l_err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
l_err->collectTrace(NVDIMM_COMP_NAME, 256);
ERRORLOG::errlCommit(l_err, NVDIMM_COMP_ID);
}

}

// Self-refresh is done at the port level
Expand Down Expand Up @@ -1141,6 +1159,33 @@ errlHndl_t nvdimmRestore(TargetHandleList i_nvdimmList, uint8_t &i_mpipl)
}
}

if (i_mpipl)
{
for (const auto & l_nvdimm : i_nvdimmList)
{
TargetHandleList l_mcaList;
errlHndl_t err = nullptr;
getParentAffinityTargets(l_mcaList, l_nvdimm, CLASS_UNIT, TYPE_MCA);
assert(l_mcaList.size(), "nvdimmRestore() failed to find parent MCA.");

// Re-validate the BAR after restore
fapi2::Target<fapi2::TARGET_TYPE_MCA> l_fapi_mca(l_mcaList[0]);
FAPI_INVOKE_HWP(err, mss::nvdimm::change_bar_valid_state, l_fapi_mca, HIGH);

// This should not fail at all (scom read/write). If it does, post an informational log
// to leave some breadcrumbs
if (err)
{
TRACFCOMP(g_trac_nvdimm, ERR_MRK"nvdimmRestore() HUID[%X] i_mpipl[%u] failed to invalidate BAR!",
get_huid(l_nvdimm), i_mpipl);

err->setSev(ERRORLOG::ERRL_SEV_INFORMATIONAL);
err->collectTrace(NVDIMM_COMP_NAME, 256);
ERRORLOG::errlCommit(err, NVDIMM_COMP_ID);
}
}
}

}while(0);

TRACUCOMP(g_trac_nvdimm, EXIT_MRK"nvdimmRestore() restore completed!!");
Expand Down

0 comments on commit d97b706

Please sign in to comment.