diff options
author | Tsung Yeung <tyeung@us.ibm.com> | 2019-04-03 12:16:43 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-04-04 14:46:19 -0500 |
commit | 9291b67c357d4dca66bf2e969a153e854fe13f23 (patch) | |
tree | ee5a1cb1b5cf0b7defff7e4c6fc14b44d67569f0 | |
parent | 4d2fdefa996b149ab4917330d85b83e96c30ac7a (diff) | |
download | talos-hostboot-9291b67c357d4dca66bf2e969a153e854fe13f23.tar.gz talos-hostboot-9291b67c357d4dca66bf2e969a153e854fe13f23.zip |
NVDIMM - erase after arm to prevent stale image getting restored on next boot
Change-Id: I44626ab7d2c9cb10eac0a2ae2aa3d2217d307d69
CQ:SW459987
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75472
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-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>
Reviewed-by: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r-- | src/usr/isteps/nvdimm/runtime/nvdimm_rt.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C index c45686754..267fab07c 100644 --- a/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C +++ b/src/usr/isteps/nvdimm/runtime/nvdimm_rt.C @@ -410,6 +410,35 @@ bool nvdimmArm(TARGETING::TargetHandleList &i_nvdimmTargetList) o_arm_successful = false; continue; } + + // After arming the trigger, erase the image to prevent the possible + // stale image getting the restored on the next boot in case of failed + // save. + l_err = nvdimmEraseNF(l_nvdimm); + if (l_err) + { + NVDIMM::nvdimmSetStatusFlag(l_nvdimm, NVDIMM::NSTD_ERR_NOBKUP); + // Committing the error as we don't want this to interrupt + // the boot. This will notify the user that action is needed + // on this module + l_err->setSev(ERRORLOG::ERRL_SEV_PREDICTIVE); + l_err->collectTrace(NVDIMM_COMP_NAME, 1024); + errlCommit( l_err, NVDIMM_COMP_ID ); + o_arm_successful = false; + + // If the erase failed let's disarm the trigger + l_err = nvdimmChangeArmState(l_nvdimm, DISARM_TRIGGER); + if (l_err) + { + TRACFCOMP(g_trac_nvdimm, ERR_MRK"nvdimmArm() nvdimm[%X], error disarming the nvdimm!", + TARGETING::get_huid(l_nvdimm)); + l_err->setSev(ERRORLOG::ERRL_SEV_PREDICTIVE); + l_err->collectTrace(NVDIMM_COMP_NAME, 1024); + errlCommit(l_err, NVDIMM_COMP_ID); + } + + continue; + } } TRACFCOMP(g_trac_nvdimm, EXIT_MRK"nvdimmArm() returning %d", |