diff options
author | Marty Gloff <mgloff@us.ibm.com> | 2018-05-24 10:18:00 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-05-24 16:43:01 -0400 |
commit | cd8df2a4b0330bf0f5457463d503f132cb649ca3 (patch) | |
tree | 46b1bf42e97f718082e77e2eb51c07c3f1ac1f7c /src/usr/hwas/common/deconfigGard.C | |
parent | d161474ee597e6242d3ee4a82eb1f8024070834a (diff) | |
download | talos-hostboot-cd8df2a4b0330bf0f5457463d503f132cb649ca3.tar.gz talos-hostboot-cd8df2a4b0330bf0f5457463d503f132cb649ca3.zip |
Clear Block Spec Deconfig Attribute when Gard is removed
In the Resource Recovery redesign, the Block Spec Deconfig attribute gets set
when a check for minimal hardware fails to find enough hardware, and it gets
cleared when there is a hardware change. Now, the Block Spec Deconfig attribute
will also be cleared when a target that had gard applied no longer has any gard
records.
Change-Id: I8f93ca4821b1360638a94855c0aadb3dda365046
CQ: SW429890
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59325
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Brian E. Bakke <bbakke@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/hwas/common/deconfigGard.C')
-rw-r--r-- | src/usr/hwas/common/deconfigGard.C | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C index a1ab9bfc2..89d2e5791 100644 --- a/src/usr/hwas/common/deconfigGard.C +++ b/src/usr/hwas/common/deconfigGard.C @@ -187,6 +187,7 @@ errlHndl_t DeconfigGard::applyGardRecord(Target *i_pTarget, break; } + update_hwas_changed_mask(i_pTarget, HWAS_CHANGED_BIT_GARD_APPLIED); l_pErr = platLogEvent(i_pTarget, GARD_APPLIED); if (l_pErr) { @@ -587,6 +588,15 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl( TARGETING::ATTR_BLOCK_SPEC_DECONFIG_type l_block_spec_deconfig = DeconfigGard::clearBlockSpecDeconfigForReplacedTargets(); + l_pErr = + clearBlockSpecDeconfigForUngardedTargets(l_block_spec_deconfig); + if (l_pErr) + { + HWAS_ERR("clearBlockSpecDeconfigForUngardedTargets returned an " + "error"); + break; + } + if(l_block_spec_deconfig != 0) { #if (!defined(CONFIG_CONSOLE_OUTPUT_TRACE) && defined(CONFIG_CONSOLE)) @@ -3027,5 +3037,76 @@ uint8_t DeconfigGard::clearBlockSpecDeconfigForReplacedTargets() return l_block_spec_deconfig; } // clearBlockSpecDeconfigForReplacedTargets +//****************************************************************************** +errlHndl_t + DeconfigGard::clearBlockSpecDeconfigForUngardedTargets(uint8_t &io_blockAttr) +{ + HWAS_INF("Clear Block Spec Deconfig for ungarded Targets"); + + errlHndl_t l_pErr = NULL; + GardRecords_t l_records; + + // Get system target + Target *pSys; + targetService().getTopLevelTarget(pSys); + + do + { + // Check Block Spec Deconfig value + if(io_blockAttr == 0) + { + // Block Spec Deconfig is already cleared + HWAS_INF("Block Spec Deconfig already cleared"); + } + + // Create the predicate with HWAS changed state and our GARD_APPLIED bit + PredicateHwasChanged l_predicateHwasChanged; + l_predicateHwasChanged.changedBit(HWAS_CHANGED_BIT_GARD_APPLIED, true); + + // Go through all targets + for (TargetIterator t_iter = targetService().begin(); + t_iter != targetService().end(); + ++t_iter) + { + Target* l_pTarget = *t_iter; + + // Check if target has gard applied + if (l_predicateHwasChanged(l_pTarget)) + { + // Get gard records for the target + l_pErr = platGetGardRecords(l_pTarget, l_records); + if (l_pErr) + { + break; + } + + // If there are gard records, continue to next target + if (l_records.size() > 0) + { + continue; + } + + // Check if Block Spec Deconfig is set + if(io_blockAttr == 1) + { + io_blockAttr = 0; + pSys->setAttr<ATTR_BLOCK_SPEC_DECONFIG>(io_blockAttr); + HWAS_INF("Block Spec Deconfig cleared due to no gard " + "records for 0x%.8x", + get_huid(l_pTarget)); + } + + // Clear GARD_APPLIED bit in HWAS changed flags for the target + HWAS_INF("HWAS_CHANGED_BIT_GARD_APPLIED cleared for 0x%.8x", + get_huid(l_pTarget)); + clear_hwas_changed_bit(l_pTarget, + HWAS_CHANGED_BIT_GARD_APPLIED); + } + } // for + } while (0); + + return l_pErr; +} // clearBlockSpecDeconfigForUngardedTargets + } // namespace HWAS |