diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2017-05-19 11:06:22 -0500 |
---|---|---|
committer | Martha Broyles <mbroyles@us.ibm.com> | 2017-05-19 14:07:52 -0400 |
commit | 74eb0dbfb80468860be178962e5302c301a21580 (patch) | |
tree | 9e0ce381ab9b317eeb4a79e7504b2ef574445abe | |
parent | 52e2dab2a303b7358f1e6b6d9379424c78472e42 (diff) | |
download | talos-occ-74eb0dbfb80468860be178962e5302c301a21580.tar.gz talos-occ-74eb0dbfb80468860be178962e5302c301a21580.zip |
Prevent WOF related error logs when WOF disabled
Change-Id: I6ec583aa8b214d72f1fc2570a429cf160d2eb09b
CQ: SW389424
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40756
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
-rwxr-xr-x | src/occ_405/main.c | 4 | ||||
-rw-r--r-- | src/occ_405/wof/wof.c | 154 |
2 files changed, 86 insertions, 72 deletions
diff --git a/src/occ_405/main.c b/src/occ_405/main.c index 808d61d..d69edf2 100755 --- a/src/occ_405/main.c +++ b/src/occ_405/main.c @@ -690,7 +690,7 @@ void read_wof_header(void) commitErrl(&l_errl); // We were unable to get the WOF header thus it should not be run. - g_amec->wof.wof_disabled |= WOF_RC_NO_WOF_HEADER_MASK; + set_clear_wof_disabled( SET, WOF_RC_NO_WOF_HEADER_MASK ); } } else @@ -698,7 +698,7 @@ void read_wof_header(void) // We were unable to get the WOF header thus it should not be run. MAIN_TRAC_INFO("read_wof_header(): WOF header address is 0 or NOT" " 128-byte aligned, WOF is disabled"); - g_amec->wof.wof_disabled |= WOF_RC_NO_WOF_HEADER_MASK; + set_clear_wof_disabled( SET, WOF_RC_NO_WOF_HEADER_MASK ); } } // end read_wof_header() diff --git a/src/occ_405/wof/wof.c b/src/occ_405/wof/wof.c index b579fc1..1f4ae23 100644 --- a/src/occ_405/wof/wof.c +++ b/src/occ_405/wof/wof.c @@ -1303,92 +1303,106 @@ void set_clear_wof_disabled( uint8_t i_action, uint32_t prev_wof_disabled = g_wof->wof_disabled; - if( i_action == SET ) + do { - // Set the bit - g_wof->wof_disabled |= i_bit_mask; - // If error has already been logged, trace and skip - if( L_errorLogged ) + if( i_action == SET ) { - CMDH_TRAC_ERR("Another WOF error was encountered!" - " wof_disabled=0x%08x", - g_wof->wof_disabled); + // Set the bit + g_wof->wof_disabled |= i_bit_mask; + // If error has already been logged, trace and skip + if( L_errorLogged ) + { + CMDH_TRAC_ERR("Another WOF error was encountered!" + " wof_disabled=0x%08x", + g_wof->wof_disabled); + } + else + { + CMDH_TRAC_ERR("WOF encountered an error. wof_disabled =" + " 0x%08x", g_wof->wof_disabled ); + // If wof is disabled in driver, skip generating all error logs + if( g_wof->wof_disabled & WOF_RC_DRIVER_WOF_DISABLED ) + { + static bool trace = true; + if(trace) + { + CMDH_TRAC_INFO("WOF is disabled in the driver."); + trace = false; + } + break; + } + // Make sure the reason requires an error log + if( g_wof->wof_disabled & ERRL_RETURN_CODES ) + { + // Create error log + /** @errortype + * @moduleid SET_CLEAR_WOF_DISABLED + * @reasoncode WOF_DISABLED_RC + * @userdata1 current wof_disabled + * @userdata2 Bit requested to be set + * @userdata4 OCC_NO_EXTENDED_RC + * @devdesc WOF has been disabled due to an error + */ + l_errl = createErrl( + SET_CLEAR_WOF_DISABLED, + WOF_DISABLED_RC, + OCC_NO_EXTENDED_RC, + ERRL_SEV_UNRECOVERABLE, + NULL, + DEFAULT_TRACE_SIZE, + g_wof->wof_disabled, + i_bit_mask ); + + // commit the error log + commitErrl( &l_errl ); + L_errorLogged = true; + } + // if the previous wof_disabled was all zeros, + // send IPC command to PGPE to disable wof + if( !prev_wof_disabled ) + { + // Disable WOF + disable_wof(); + } + } } - else + else if ( i_action == CLEAR ) { - CMDH_TRAC_ERR("WOF encountered an error. wof_disabled =" - " 0x%08x", g_wof->wof_disabled ); - // Make sure the reason requires an error log - if( g_wof->wof_disabled & ERRL_RETURN_CODES ) + // Clear the bit + g_wof->wof_disabled &= ~i_bit_mask; + // If clearing the bit put wof_disabled at all 0's AND + // wof_disabled was not already all 0's, wof is being + // re-enabled. Log informational error. + if( prev_wof_disabled && !g_wof->wof_disabled ) { - // Create error log - /** @errortype + /** @ + * @errortype * @moduleid SET_CLEAR_WOF_DISABLED - * @reasoncode WOF_DISABLED_RC - * @userdata1 current wof_disabled - * @userdata2 Bit requested to be set + * @reasoncode WOF_RE_ENABLED + * @userdata1 Last Bit cleared + * @userdata2 0 * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc WOF has been disabled due to an error + * @devdesc WOF is being re-enabled */ l_errl = createErrl( - SET_CLEAR_WOF_DISABLED, - WOF_DISABLED_RC, - OCC_NO_EXTENDED_RC, - ERRL_SEV_UNRECOVERABLE, - NULL, - DEFAULT_TRACE_SIZE, - g_wof->wof_disabled, - i_bit_mask ); + SET_CLEAR_WOF_DISABLED, + WOF_RE_ENABLED, + OCC_NO_EXTENDED_RC, + ERRL_SEV_INFORMATIONAL, + NULL, + DEFAULT_TRACE_SIZE, + i_bit_mask, + 0 ); // commit the error log commitErrl( &l_errl ); - L_errorLogged = true; - } - // if the previous wof_disabled was all zeros, - // send IPC command to PGPE to disable wof - if( !prev_wof_disabled ) - { - // Disable WOF - disable_wof(); } } - } - else if ( i_action == CLEAR ) - { - // Clear the bit - g_wof->wof_disabled &= ~i_bit_mask; - // If clearing the bit put wof_disabled at all 0's AND - // wof_disabled was not already all 0's, wof is being - // re-enabled. Log informational error. - if( prev_wof_disabled && !g_wof->wof_disabled ) + else { - /** @ - * @errortype - * @moduleid SET_CLEAR_WOF_DISABLED - * @reasoncode WOF_RE_ENABLED - * @userdata1 Last Bit cleared - * @userdata2 0 - * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc WOF is being re-enabled - */ - l_errl = createErrl( - SET_CLEAR_WOF_DISABLED, - WOF_RE_ENABLED, - OCC_NO_EXTENDED_RC, - ERRL_SEV_INFORMATIONAL, - NULL, - DEFAULT_TRACE_SIZE, - i_bit_mask, - 0 ); - - // commit the error log - commitErrl( &l_errl ); + CMDH_TRAC_ERR("Invalid action given. Ignoring for now..."); } - } - else - { - CMDH_TRAC_ERR("Invalid action given. Ignoring for now..."); - } + }while( 0 ); } /** |