From 50cfdf257476da2f34b49eb991eaed257829da23 Mon Sep 17 00:00:00 2001 From: Andres Lugo-Reyes Date: Thu, 12 Oct 2017 10:45:54 -0500 Subject: 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 Tested-by: FSP CI Jenkins Reviewed-by: Martha Broyles --- src/occ_405/wof/wof.c | 38 ++++++++++++++++++++++++++++++++------ src/occ_405/wof/wof.h | 4 +++- 2 files changed, 35 insertions(+), 7 deletions(-) (limited to 'src/occ_405/wof') 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 -- cgit v1.2.1