summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt
diff options
context:
space:
mode:
authorChris Cain <cjcain@us.ibm.com>2016-01-29 10:57:45 -0600
committerStephen Cprek <smcprek@us.ibm.com>2016-02-19 17:06:35 -0600
commit72155d6f4c15beb0f900f49932efe7df3536a954 (patch)
tree05e3585eb42d7dcbd5fd77c223193d8e8f247359 /src/usr/htmgt
parent294b2eebe180188f5c2a9d9336aeb25fd81f02b0 (diff)
downloadtalos-hostboot-72155d6f4c15beb0f900f49932efe7df3536a954.tar.gz
talos-hostboot-72155d6f4c15beb0f900f49932efe7df3536a954.zip
Fix regulator efficiency for memory throttling
Change-Id: I2e773a6bbbafe8d83ab76b1bf92bf56c8ac1fbbd CQ: SW333572 Forwardport: yes Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/23903 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt')
-rw-r--r--src/usr/htmgt/htmgt_memthrottles.C16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/usr/htmgt/htmgt_memthrottles.C b/src/usr/htmgt/htmgt_memthrottles.C
index 2fd0e6cec..f731a98c3 100644
--- a/src/usr/htmgt/htmgt_memthrottles.C
+++ b/src/usr/htmgt/htmgt_memthrottles.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
+/* Contributors Listed Below - COPYRIGHT 2014,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -324,7 +324,7 @@ void memPowerThrottleRedPower(TargetHandleList & i_mbas,
{
Target* sys = NULL;
TargetHandleList::iterator mba;
- uint16_t power = 0;
+ uint32_t power = 0;
uint32_t wattTarget = 0;
uint32_t nChip = 0;
uint32_t nMBA = 0;
@@ -337,10 +337,10 @@ void memPowerThrottleRedPower(TargetHandleList & i_mbas,
power = sys->getAttr<ATTR_OPEN_POWER_N_PLUS_ONE_MAX_MEM_POWER_WATTS>();
power *= 100; //centiWatts
- //Account for the regulator efficiency, if supplied
+ //Account for the regulator efficiency (percentage), if supplied
if (i_efficiency != 0)
{
- power *= i_efficiency;
+ power = (power * i_efficiency) / 100;
}
//Find the Watt target for each MBA
@@ -404,7 +404,7 @@ void memPowerThrottleOverSub(TargetHandleList & i_mbas,
{
Target* sys = NULL;
TargetHandleList::iterator mba;
- uint16_t power = 0;
+ uint32_t power = 0;
uint32_t wattTarget = 0;
uint32_t nChip = 0;
uint32_t nMBA = 0;
@@ -417,10 +417,10 @@ void memPowerThrottleOverSub(TargetHandleList & i_mbas,
power = sys->getAttr<ATTR_OPEN_POWER_N_MAX_MEM_POWER_WATTS>();
power *= 100; //centiWatts
- //Account for the regulator efficiency, if supplied
+ //Account for the regulator efficiency (percentage), if supplied
if (i_efficiency != 0)
{
- power *= i_efficiency;
+ power = (power * i_efficiency) / 100;
}
//Find the Watt target for each MBA
@@ -487,7 +487,7 @@ void calcMemThrottles()
TMGT_INF("calcMemThrottles: Using nSafeModeMBA=0x%X, nSafeModeChip=0x%X",
nSafeModeMBA, nSafeModeChip);
- TMGT_INF("calcMemThrottles: Using utilization=0x%X, efficiency=0x%X",
+ TMGT_INF("calcMemThrottles: Using utilization=%d, efficiency=%d percent",
utilization, efficiency);
OpenPOWER on IntegriCloud