summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
diff options
context:
space:
mode:
authorJacob Harvey <jlharvey@us.ibm.com>2016-11-03 21:55:15 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-11-11 17:19:09 -0500
commit5f8e27a099d7c54c5243442feba1d2f493272708 (patch)
tree02ee41ec26517073727387b8c064839c3c4ae642 /src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
parent63954bd3be851e39f8722e490926c2cfee752b4b (diff)
downloadtalos-hostboot-5f8e27a099d7c54c5243442feba1d2f493272708.tar.gz
talos-hostboot-5f8e27a099d7c54c5243442feba1d2f493272708.zip
Added default values if no power_curve attrs
Change-Id: Ia913efb29359b5ea97c4aa31b036dd99588c5ece Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32221 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Michael D. Pardeik <pardeik@us.ibm.com> Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32222 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
index 3935ef805..11337674a 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_eff_config_thermal.C
@@ -67,23 +67,45 @@ extern "C"
std::vector< uint64_t > l_tintercept (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS, 0);
std::vector< uint64_t > l_tthermal_power_limit (mss::power_thermal::SIZE_OF_THERMAL_ATTR, 0);
- std::vector<fapi2::buffer< uint64_t>> l_slope (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS);
- std::vector<fapi2::buffer< uint64_t>> l_intercept (mss::power_thermal::SIZE_OF_POWER_CURVES_ATTRS);
- std::vector<fapi2::buffer< uint64_t>> l_thermal_power_limit (mss::power_thermal::SIZE_OF_THERMAL_ATTR);
+ std::vector<fapi2::buffer< uint64_t>> l_slope = {};
+ std::vector<fapi2::buffer< uint64_t>> l_intercept = {};
+ std::vector<fapi2::buffer< uint64_t>> l_thermal_power_limit = {};
FAPI_TRY( mss::mrw_pwr_slope (l_tslope.data() ));
FAPI_TRY( mss::mrw_pwr_intercept (l_tintercept.data()) );
FAPI_TRY( mss::mrw_thermal_memory_power_limit (l_tthermal_power_limit.data()) );
-
- for (size_t i = 0; i < l_slope.size(); ++i)
{
- l_slope[i] = fapi2::buffer<uint64_t> (l_tslope[i]);
- l_intercept[i] = fapi2::buffer<uint64_t>(l_tintercept[i]);
- }
+ for (auto l_tslope_iter = l_tslope.begin(); l_tslope_iter != l_tslope.end(); ++l_tslope_iter)
+ {
+ auto l_slope_buf = fapi2::buffer<uint64_t> (*l_tslope_iter);
- for (size_t i = 0; i < l_thermal_power_limit.size(); ++i)
- {
- l_thermal_power_limit[i] = fapi2::buffer<uint64_t> (l_tthermal_power_limit[i]);
+ if (l_slope_buf != 0)
+ {
+ l_slope.push_back(l_slope_buf);
+ }
+ }
+
+ for (auto l_tintercept_iter = l_tintercept.begin(); l_tintercept_iter != l_tintercept.end(); ++l_tintercept_iter)
+ {
+ auto l_intercept_buf = fapi2::buffer<uint64_t> (*l_tintercept_iter);
+
+ if (l_intercept_buf != 0)
+ {
+ l_intercept.push_back(l_intercept_buf);
+ }
+ }
+
+ for (auto l_tthermal_iter = l_tthermal_power_limit.begin();
+ l_tthermal_iter != l_tthermal_power_limit.end();
+ ++l_tthermal_iter)
+ {
+ auto l_tthermal_buf = fapi2::buffer<uint64_t> (*l_tthermal_iter);
+
+ if (l_tthermal_buf != 0)
+ {
+ l_thermal_power_limit.push_back(l_tthermal_buf);
+ }
+ }
}
//Restore runtime_throttles from safemode setting
OpenPOWER on IntegriCloud