diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2017-10-12 10:45:54 -0500 |
---|---|---|
committer | Martha Broyles <mbroyles@us.ibm.com> | 2017-10-19 11:43:29 -0400 |
commit | 50cfdf257476da2f34b49eb991eaed257829da23 (patch) | |
tree | 57dcaf6a50ea79970ae066af4519a5b421b861d0 | |
parent | 53f78dee6ba23104bae04d18c386c5b2323274e7 (diff) | |
download | talos-occ-50cfdf257476da2f34b49eb991eaed257829da23.tar.gz talos-occ-50cfdf257476da2f34b49eb991eaed257829da23.zip |
Prevent WOF related error logs in states that don't support WOF
Change-Id: Ica38f94423a763d116ad24082e776975828f6fde
CQ:SW404551
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48300
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
-rw-r--r-- | src/occ_405/pgpe/pgpe_interface.c | 2 | ||||
-rwxr-xr-x | src/occ_405/state.c | 15 | ||||
-rw-r--r-- | src/occ_405/wof/wof.c | 38 | ||||
-rw-r--r-- | src/occ_405/wof/wof.h | 4 |
4 files changed, 50 insertions, 9 deletions
diff --git a/src/occ_405/pgpe/pgpe_interface.c b/src/occ_405/pgpe/pgpe_interface.c index fad5bd6..eaaa340 100644 --- a/src/occ_405/pgpe/pgpe_interface.c +++ b/src/occ_405/pgpe/pgpe_interface.c @@ -728,8 +728,6 @@ void pgpe_start_suspend_callback(void) // upon successful pstates START, assign G_proc_pmcr_owner (OCC/CHAR/HOST) G_proc_pmcr_owner = G_start_suspend_parms.pmcr_owner; - // Clear WOF Pstate status flag - set_clear_wof_disabled( CLEAR, WOF_RC_PSTATE_PROTOCOL_OFF ); } // this was a command to disable pstates else if(G_start_suspend_parms.action == PGPE_ACTION_PSTATE_STOP) diff --git a/src/occ_405/state.c b/src/occ_405/state.c index 7b2a4a5..9474d0b 100755 --- a/src/occ_405/state.c +++ b/src/occ_405/state.c @@ -40,6 +40,7 @@ #include "pgpe_interface.h" #include "pstate_pgpe_occ_api.h" #include "amec_sys.h" +#include "wof.h" // Maximum time to wait for a PGPE task before timeout // must wait at least 1 tick time to ensure proc_data_control() runs to set @@ -296,6 +297,9 @@ errlHndl_t SMGR_all_to_standby() TRAC_IMP("SMGR: Transition from State (%d) to Standby Started", CURRENT_STATE()); + // set STATE_CHANGE WOF disabled flag + set_clear_wof_disabled( SET, WOF_RC_STATE_CHANGE ); + // if Psates in transition (a pgpe_start_suspend IPC call still running), // wait until it is settled up to WAIT_PGPE_TASK_TIMEOUT usec while( (G_proc_pstate_status == PSTATES_IN_TRANSITION) && @@ -531,6 +535,8 @@ errlHndl_t SMGR_observation_to_active() (SMGR_validate_get_valid_states() & SMGR_MASK_ACTIVE_READY)) { TRAC_IMP("SMGR: Observation to Active Transition Started"); + // Clear STATE_CHANGE WOF disabled flag + set_clear_wof_disabled( CLEAR, WOF_RC_STATE_CHANGE ); l_pstate = proc_freq2pstate(G_proc_fmax_mhz); l_rc = pgpe_set_clip_blocking(l_pstate); @@ -715,6 +721,8 @@ errlHndl_t SMGR_characterization_to_active() do { + // Clear STATE_CHANGE WOF disabled flag + set_clear_wof_disabled( CLEAR, WOF_RC_STATE_CHANGE ); // change PMCR ownership via an IPC call to PGPE based on system type. if(G_sysConfigData.system_type.kvm) { @@ -825,6 +833,8 @@ errlHndl_t SMGR_active_to_observation() do { + // Set STATE_CHANGE WOF disabled + set_clear_wof_disabled( SET, WOF_RC_STATE_CHANGE ); // wait until task_core_data_control() declares that // OCC is ready to transition to Observation state while(!G_active_to_observation_ready) @@ -973,6 +983,8 @@ errlHndl_t SMGR_active_to_characterization() do { + // set STATE_CHANGE WOF disabled flag + set_clear_wof_disabled( SET, WOF_RC_STATE_CHANGE ); // set pstate clips l_pstate = proc_freq2pstate(G_proc_fmax_mhz); rc = pgpe_set_clip_blocking(l_pstate); @@ -1110,6 +1122,9 @@ errlHndl_t SMGR_all_to_safe() G_occ_external_req_state = OCC_STATE_SAFE; } + // set STATE_CHANGE WOF disabled flag + set_clear_wof_disabled( SET, WOF_RC_STATE_CHANGE ); + // If we are master, we will wait 15ms to go to full on safe mode // This is to give the slaves time to see that we are broadcasting // Safe State, and react to it. This must be > 10ms. It doesn't hurt diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c index 2e3d66d..f2b5c3e 100644 --- a/src/occ_405/wof/wof.c +++ b/src/occ_405/wof/wof.c @@ -131,6 +131,9 @@ void call_wof_main( void ) // Variable to ensure we do not keep trying to send the wof control static bool L_wof_control_last_chance = false; + // Variable to keep track of PState enablement to prevent setting/clearing + // wof_disabled bit every iteration. + static uint8_t L_pstate_protocol_off = 0; // GpeRequest more than 1 extra time. bool enable_success = false; do @@ -153,13 +156,22 @@ void call_wof_main( void ) g_wof->vfrt_callback_error = 0; } + // If the 405 turned WOF off on pgpe and it is the only bit set + // clear the bit so we can re-enable WOF + if( g_wof->pgpe_wof_off && + (g_wof->wof_disabled == WOF_RC_PGPE_WOF_DISABLED) ) + { + g_wof->pgpe_wof_off = 0; + set_clear_wof_disabled( CLEAR, WOF_RC_PGPE_WOF_DISABLED ); + } + // Make sure wof has not been disabled if( g_wof->wof_disabled ) { - if( g_wof->pgpe_wof_off ) + if( g_wof->pgpe_wof_disabled ) { set_clear_wof_disabled( SET, WOF_RC_PGPE_WOF_DISABLED ); - g_wof->pgpe_wof_off = 0; + g_wof->pgpe_wof_disabled = 0; } break; } @@ -167,10 +179,24 @@ void call_wof_main( void ) // Make sure Pstate Protocol is on if(G_proc_pstate_status != PSTATES_ENABLED) { - INTR_TRAC_ERR("WOF Disabled! Pstate Protocol off"); - set_clear_wof_disabled( SET, WOF_RC_PSTATE_PROTOCOL_OFF ); + if( L_pstate_protocol_off == 0 ) + { + INTR_TRAC_ERR("WOF Disabled! Pstate Protocol off"); + set_clear_wof_disabled( SET, WOF_RC_PSTATE_PROTOCOL_OFF ); + L_pstate_protocol_off = 1; + } + // Since Pstates are off, break out break; } + else if(G_proc_pstate_status == PSTATES_ENABLED) + { + if( L_pstate_protocol_off == 1 ) + { + INTR_TRAC_INFO("Pstate Protocol on! Clearing PSTATE_PROTOCOL_OFF"); + set_clear_wof_disabled( CLEAR, WOF_RC_PSTATE_PROTOCOL_OFF ); + L_pstate_protocol_off = 0; + } + } // Ensure the OCC is active if( IS_OCC_STATE_ACTIVE() ) @@ -1622,7 +1648,7 @@ void wof_control_callback( void ) if( G_wof_control_parms.msg_cb.rc == PGPE_WOF_RC_NOT_ENABLED ) { // PGPE cannot enable wof - g_wof->pgpe_wof_off = 1; + g_wof->pgpe_wof_disabled = 1; } else if( G_wof_control_parms.msg_cb.rc == PGPE_RC_SUCCESS) { @@ -1633,7 +1659,7 @@ void wof_control_callback( void ) } else { - // Record that PGPE has WOF turned off + // Record that 405 turned PGPE WOF off g_wof->pgpe_wof_off = 1; } } diff --git a/src/occ_405/wof/wof.h b/src/occ_405/wof/wof.h index 41a20fc..c0bcd77 100644 --- a/src/occ_405/wof/wof.h +++ b/src/occ_405/wof/wof.h @@ -305,8 +305,10 @@ typedef struct // Keeps track of whether we got an error in wof_vfrt_callback to be // logged later uint8_t vfrt_callback_error; - // Keeps track of whether or /not we just turned off wof on the PGPE + // Keeps track of whether the 405 was the one who disabled WOF on the PGPE uint8_t pgpe_wof_off; + // Keeps track of whether or not the PGPE can enable WOF + uint8_t pgpe_wof_disabled; // Offset into main memory with the beginning of the wof vfrt data as base uint32_t vfrt_mm_offset; // Return code returned from a bad VFRT request |