diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2017-08-02 12:55:35 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2017-08-04 15:58:07 -0400 |
commit | ff487313bea8ccd3c0a9a523860a6fe406d925bb (patch) | |
tree | d1ab384df91b936a53e7da086fd664fdcf5fd781 | |
parent | d65050138474c8450121127683ee9657ac979246 (diff) | |
download | talos-occ-ff487313bea8ccd3c0a9a523860a6fe406d925bb.tar.gz talos-occ-ff487313bea8ccd3c0a9a523860a6fe406d925bb.zip |
24x7 enable/disable counters
Change-Id: Ic6c4f85af0f7f6a51e30ce3d92e957d3ad216644
RTC:167812
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44132
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
-rw-r--r-- | src/occ_405/amec/amec_sensors_fw.c | 40 | ||||
-rwxr-xr-x | src/occ_405/errl/errl.h | 3 |
2 files changed, 41 insertions, 2 deletions
diff --git a/src/occ_405/amec/amec_sensors_fw.c b/src/occ_405/amec/amec_sensors_fw.c index fb3b9fe..daf9fd7 100644 --- a/src/occ_405/amec/amec_sensors_fw.c +++ b/src/occ_405/amec/amec_sensors_fw.c @@ -48,6 +48,7 @@ /******************************************************************************/ /* Globals */ /******************************************************************************/ +extern bool G_24x7_disabled; //************************************************************************* // Code @@ -97,8 +98,12 @@ void task_gpe_timings(task_t * i_task) errlHndl_t l_err = NULL; int rc = 0; int rc2 = 0; + static uint8_t L_idleTicks = 0; + static uint8_t L_busyTicks = 0; static bool L_first_call = TRUE; - bool l_gpe0_idle, l_gpe1_idle; + bool l_gpe0_idle = TRUE; + bool l_gpe1_idle = TRUE; + static uint8_t L_consec_trace_count[2] = {0}; gpe_gpenxiramdbg_t xsr_sprg0 = {0}; gpe_gpenxiramedr_t ir_edr = {0}; @@ -241,6 +246,39 @@ void task_gpe_timings(task_t * i_task) commitErrl( &l_err ); } + // Process GPEs timings and determine whether to disable/enable 24x7 + if(l_gpe0_idle && l_gpe1_idle) + { + // Reset how many consecutive ticks we were busy for. + L_busyTicks = 0; + + // If we were idle for at least 16 consecutive ticks, enable 24x7 + if( L_idleTicks >= 15 ) + { + G_24x7_disabled = FALSE; + } + else + { + L_idleTicks++; + } + } + else + { + // Reset how many consecutive ticks we were idle for + L_idleTicks = 0; + + // If we were busy for at least 2 consecutive ticks, disable 24x7 + if( L_busyTicks >= 1 ) + { + G_24x7_disabled = TRUE; + INCREMENT_ERR_HISTORY(ERRH_24X7_DISABLED); + } + else + { + L_busyTicks++; + } + } + L_first_call = FALSE; } diff --git a/src/occ_405/errl/errl.h b/src/occ_405/errl/errl.h index 7a1660c..29f7d40 100755 --- a/src/occ_405/errl/errl.h +++ b/src/occ_405/errl/errl.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2016 */ +/* Contributors Listed Below - COPYRIGHT 2011,2017 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -293,6 +293,7 @@ typedef enum { ERRH_DCOM_SLAVE_PBAX_READ_FAIL = 0x15, ERRH_GPE0_NOT_IDLE = 0x16, ERRH_GPE1_NOT_IDLE = 0x17, + ERRH_24X7_DISABLED = 0x18, } ERR_HISTORY_INDEX; #define INCREMENT_ERR_HISTORY(errorIndex) { \ if ((errorIndex < ERR_HISTORY_SIZE) && (G_error_history[errorIndex] < 255)) { \ |