summaryrefslogtreecommitdiffstats
path: root/src/occ_405/amec/amec_controller.c
diff options
context:
space:
mode:
authormbroyles <mbroyles@us.ibm.com>2018-01-10 16:18:59 -0600
committerMartha Broyles <mbroyles@us.ibm.com>2018-01-15 13:42:20 -0500
commit2397cb606cda005ae0fdd8455a827450fb4d8b4f (patch)
treefc19b43040853cc2878a4f0003bc2458128b4781 /src/occ_405/amec/amec_controller.c
parentd868b77dfc6afd90d4fea874ae4a1175fffffaed (diff)
downloadtalos-occ-2397cb606cda005ae0fdd8455a827450fb4d8b4f.tar.gz
talos-occ-2397cb606cda005ae0fdd8455a827450fb4d8b4f.zip
Handle PGPE timeouts as workaround for prolonged droop events
Add "CLIP" information to poll response Fix incorrectly throttling due to power when all cores are in stop 2 or greater Change-Id: I502cc65ad8c4cffd7f9a1442fd4de185f3cac6e2 RTC: 183700 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51741 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com> Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Diffstat (limited to 'src/occ_405/amec/amec_controller.c')
-rw-r--r--src/occ_405/amec/amec_controller.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/occ_405/amec/amec_controller.c b/src/occ_405/amec/amec_controller.c
index f310208..530f53f 100644
--- a/src/occ_405/amec/amec_controller.c
+++ b/src/occ_405/amec/amec_controller.c
@@ -457,16 +457,25 @@ uint16_t amec_controller_speed2freq (const uint16_t i_speed, const uint16_t i_fm
/*------------------------------------------------------------------------*/
/* Code */
/*------------------------------------------------------------------------*/
- l_temp16 = i_fmax;
- l_tempreg = (uint16_t)i_speed;
- l_temp32 = ((uint32_t)l_tempreg)*((uint32_t)l_temp16);
- l_temp16 = (uint16_t)1000;
- l_divide32[1] = (uint32_t)l_temp16;
- l_divide32[0] = (uint32_t)l_temp32;
- l_divide32[0] /= l_divide32[1];
- l_temp32 = l_divide32[0];
- l_freq = (uint16_t)l_temp32; /* freq will always fit in 16 bits */
-
+ // to handle max freq changing (i.e. mode change) between now and running amec_slv_proc_voting_box
+ // if speed is unconstrained set freq to unconstrained so voting box will use
+ // the most recent maximum frequency
+ if(i_speed >= g_amec->sys.max_speed)
+ {
+ l_freq = 0xFFFF;
+ }
+ else
+ {
+ l_temp16 = i_fmax;
+ l_tempreg = (uint16_t)i_speed;
+ l_temp32 = ((uint32_t)l_tempreg)*((uint32_t)l_temp16);
+ l_temp16 = (uint16_t)1000;
+ l_divide32[1] = (uint32_t)l_temp16;
+ l_divide32[0] = (uint32_t)l_temp32;
+ l_divide32[0] /= l_divide32[1];
+ l_temp32 = l_divide32[0];
+ l_freq = (uint16_t)l_temp32; /* freq will always fit in 16 bits */
+ }
return l_freq;
}
OpenPOWER on IntegriCloud