diff options
author | Chris Cain <cjcain@us.ibm.com> | 2018-03-14 10:28:46 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-03-19 17:10:49 -0400 |
commit | 24780f003a4bc81483953ec57f7867a4e018d0dc (patch) | |
tree | f52aef4b43bfbd53083b34653569a015ed157853 /src/usr | |
parent | 43904dc3b8a4bf86209d4a3b48098b00e11c173a (diff) | |
download | talos-hostboot-24780f003a4bc81483953ec57f7867a4e018d0dc.tar.gz talos-hostboot-24780f003a4bc81483953ec57f7867a4e018d0dc.zip |
HTMGT: Cache user power limit from BMC and add proc callout for 2AEx errors
Change-Id: Ib8918b03bfadd2948fe98e37b7e695c6df2ac7cb
CQ: SW414473
CQ: SW413111
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55897
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: Sheldon Bailey <baileysh@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/htmgt/htmgt_activate.C | 53 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_occcmd.C | 22 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types_openpower.xml | 16 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/target_types_openpower.xml | 3 |
4 files changed, 80 insertions, 14 deletions
diff --git a/src/usr/htmgt/htmgt_activate.C b/src/usr/htmgt/htmgt_activate.C index b8dd0e862..8e38899d8 100644 --- a/src/usr/htmgt/htmgt_activate.C +++ b/src/usr/htmgt/htmgt_activate.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2017 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -51,6 +51,7 @@ namespace HTMGT uint8_t * G_simicsHomerBuffer = NULL; #endif +#define BMC_LIMIT_WAS_READ 0xFF000000 // Wait for all OCCs to reach ready state errlHndl_t waitForOccReady() @@ -199,15 +200,39 @@ namespace HTMGT err = SENSOR::getUserPowerLimit(limit, active); if (err) { - TMGT_ERR("sendOccUserPowerCap: Error getting user " - "power limit"); - break; + const uint32_t saved_power_limit = + sys->getAttr<ATTR_HTMGT_SAVED_POWER_LIMIT>(); + if (saved_power_limit & BMC_LIMIT_WAS_READ) + { + // Attribute has been written since the power on, + // use the saved limit/active. + limit = saved_power_limit & 0x0000FFFF; + active = (saved_power_limit >> 16) & 0x00FF; + TMGT_INF("SENSOR::getUserPowerLimit failed with rc=0x%04X. " + "Using prior values: limit %dW, active: %c", + err->reasonCode(), limit, active?'Y':'N'); + } + else + { + TMGT_ERR("sendOccUserPowerCap: Error getting user " + "power limit from BMC, rc=0x%04X", + err->reasonCode()); + break; + } + + } + else + { + // Write attribute with power limit and state + TMGT_INF("SENSOR::getUserPowerLimit returned %dW, active: %c", + limit, active?'Y':'N'); + const uint32_t saved_limit = BMC_LIMIT_WAS_READ | + ((active?0x01:0x00) << 16) | limit; + sys->setAttr<TARGETING::ATTR_HTMGT_SAVED_POWER_LIMIT> + (saved_limit); } #endif - TMGT_INF("SENSOR::getUserPowerLimit returned %d, active = %d", - limit, active); - if (active) { //Make sure this value is between the min & max allowed @@ -216,18 +241,24 @@ namespace HTMGT max = getMaxPowerCap(sys, is_redundant); if ((limit != 0) && (limit < min)) { - TMGT_INF("sendOccUserPowerCap: User power cap %d is below" + TMGT_INF("sendOccUserPowerCap: User power cap %dW is below" " the minimum of %d, clipping value", limit, min); limit = min; } else if (limit > max) { - TMGT_INF("sendOccUserPowerCap: User power cap %d is above" + TMGT_INF("sendOccUserPowerCap: User power cap %dW is above" " the maximum of %d, clipping value", limit, min); limit = max; } + else if (limit == 0) + { + TMGT_ERR("sendOccUserPowerCap: BMC is reporting that user " + "cap is enabled, but the value is 0W!"); + active = false; + } } else { @@ -243,7 +274,7 @@ namespace HTMGT data[0] = limit >> 8; data[1] = limit & 0xFF; - TMGT_INF("sendOccUserPowerCap: Sending power cap %d to OCC %d", + TMGT_INF("sendOccUserPowerCap: Sending power cap %dW to OCC %d", limit, occ->getInstance()); if (limit > 0) { @@ -257,7 +288,7 @@ namespace HTMGT if (err) { TMGT_ERR("sendOccUserPowerCap: Failed sending command " - "to OCC %d with rc = 0x%04X", + "to OCC%d with rc=0x%04X", occ->getInstance(), err->reasonCode()); break; } diff --git a/src/usr/htmgt/htmgt_occcmd.C b/src/usr/htmgt/htmgt_occcmd.C index 05b5b1657..fbb380535 100644 --- a/src/usr/htmgt/htmgt_occcmd.C +++ b/src/usr/htmgt/htmgt_occcmd.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2017 */ +/* Contributors Listed Below - COPYRIGHT 2014,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -858,6 +858,26 @@ namespace HTMGT iv_Occ->collectCheckpointScomData(l_excErr); } + // Add processor callout + TARGETING::ConstTargetHandle_t procTarget = + TARGETING::getParentChip(iv_Occ->getTarget()); + if (nullptr != procTarget) + { + const unsigned long huid = + procTarget->getAttr<TARGETING::ATTR_HUID>(); + TMGT_ERR("handleOccException: Adding processor " + "callout (HUID=0x%0lX)", huid); + l_excErr->addHwCallout(procTarget, + HWAS::SRCI_PRIORITY_MED, + HWAS::NO_DECONFIG, + HWAS::GARD_NULL); + } + else + { + TMGT_ERR("handleOccException: Unable to determine " + "parent chip to add callout"); + } + // Add OCC trace buffer to error log (ERR, IMP, INF) iv_Occ->addOccTrace( l_excErr ); diff --git a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml index d7f25baec..c49d2f75a 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_openpower.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016,2017 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -1323,6 +1323,20 @@ ID for the sensor number returned with the elog. --> <readable/> </attribute> +<attribute> + <id>HTMGT_SAVED_POWER_LIMIT</id> + <description>User power limit information from the BMC to be used if + communication with the BMC is lost after system is powered on. + Used internally by HTMGT. + </description> + <simpleType> + <uint32_t></uint32_t> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> +</attribute> + <!-- end HTMGT attributes --> <attribute> diff --git a/src/usr/targeting/common/xmltohb/target_types_openpower.xml b/src/usr/targeting/common/xmltohb/target_types_openpower.xml index aaf06a358..83217b2da 100644 --- a/src/usr/targeting/common/xmltohb/target_types_openpower.xml +++ b/src/usr/targeting/common/xmltohb/target_types_openpower.xml @@ -5,7 +5,7 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- Contributors Listed Below - COPYRIGHT 2016,2017 --> +<!-- Contributors Listed Below - COPYRIGHT 2016,2018 --> <!-- [+] International Business Machines Corp. --> <!-- --> <!-- --> @@ -102,6 +102,7 @@ <attribute><id>PROC_MHZ_PER_WATT</id></attribute> <attribute><id>ALLOW_CALLHOME_ESELS_TO_BMC</id></attribute> <attribute><id>REPORT_THROTTLE_BELOW_NOMINAL</id></attribute> + <attribute><id>HTMGT_SAVED_POWER_LIMIT</id></attribute> </targetTypeExtension> <targetTypeExtension> |