From 6a85babe455aeb0cc37ffdaddc8764cf33ff825c Mon Sep 17 00:00:00 2001 From: Marty Gloff Date: Fri, 2 Jun 2017 16:16:53 -0500 Subject: [PATCH] Data Type of ATTR_DPO_MIN_FREQ_PERCENT should be int32_t ATTR_DPO_MIN_FREQ_PERCENT is always a negative value, so it should be int32_t type, instead of uint32_t. Make corresponding changes to DPO frequency calculation. Change-Id: I97d608d71a39b010b60b94bb740ba9fa9df7f17b CQ: SW390623 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41337 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Corey V. Swenson Reviewed-by: Daniel M. Crowell Reviewed-by: Christopher J. Cain Reviewed-by: Matthew A. Ploetz --- src/usr/isteps/istep06/call_host_voltage_config.C | 10 ++++++---- src/usr/targeting/common/xmltohb/attribute_types.xml | 6 +++--- .../targeting/common/xmltohb/simics_NIMBUS.system.xml | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/usr/isteps/istep06/call_host_voltage_config.C b/src/usr/isteps/istep06/call_host_voltage_config.C index 0a3149a1667..a939eee853a 100644 --- a/src/usr/isteps/istep06/call_host_voltage_config.C +++ b/src/usr/isteps/istep06/call_host_voltage_config.C @@ -415,13 +415,15 @@ void* call_host_voltage_config( void *io_pArgs ) l_sys->setAttr( l_nominalFreq ); // raise the min freq if there is a system policy for it - uint32_t l_dpoPercent = l_sys->getAttr(); + int32_t l_dpoPercent = l_sys->getAttr(); uint32_t l_dpoFreq = l_nominalFreq; - if( (l_dpoPercent != 0) && (l_dpoPercent < 100) ) + if( (l_dpoPercent != 0) && (l_dpoPercent > -100) ) { - l_dpoFreq = (l_nominalFreq*l_dpoPercent)/100; + uint32_t l_multiplierPercent = + static_cast(100 + l_dpoPercent); + l_dpoFreq = (l_nominalFreq*l_multiplierPercent)/100; TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, - "Computed floor=%d, DPO=%d (percent=-%d)", + "Computed floor=%d, DPO=%d (percent=%d)", l_floorFreq, l_dpoFreq, l_dpoPercent ); l_floorFreq = std::max( l_floorFreq, l_dpoFreq ); } diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index ac779bba6ef..6f764c6e29f 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -2657,13 +2657,13 @@ is used to explicitly raise the value of MIN_FREQ_MHZ above what is specified by MVPD #V data. On FSP systems this is sourced from the power_management def file. - Value must be between 0 and 100. + Value must be between 0 and -100. A value of zero indicates no override. - + 0 - + non-volatile diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml index 962aaf29df8..37befea8e7f 100644 --- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml +++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml @@ -99,7 +99,7 @@ DPO_MIN_FREQ_PERCENT - 98 + -2 REQUIRED_SYNCH_MODE