Skip to content

Commit

Permalink
Look at OCCFLG[30] to see if PGPE needs a new VFRT
Browse files Browse the repository at this point in the history
-Prevent WOF from being enabled on PowerVM until valid mode received

Change-Id: I67a955903b1b4b06b13c0a9eb80b478e393f9383
CQ:SW417438
CMVC-Prereq:1045743
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54046
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
  • Loading branch information
aalugore committed Feb 19, 2018
1 parent 919b789 commit bf6e716
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 50 deletions.
9 changes: 8 additions & 1 deletion src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -1771,6 +1771,13 @@ errlHndl_t data_store_sys_config(const cmdh_fsp_cmd_t * i_cmd_ptr,
G_sysConfigData.system_type.byte, G_sysConfigData.backplane_huid, G_sysConfigData.apss_huid,
G_sysConfigData.proc_huid);

// Check to see if we have to disable WOF due to no mode set yet on PowerVM
if( !G_sysConfigData.system_type.kvm &&
(CURRENT_MODE() == OCC_MODE_NOCHANGE) )
{
set_clear_wof_disabled(SET, WOF_RC_MODE_NO_SUPPORT_MASK);
}

//Write core temp and freq sensor ids
//Core Temp and Freq sensors are always in sequence in the table
for (l_coreIndex = 0; l_coreIndex < MAX_CORES; l_coreIndex++)
Expand Down
114 changes: 65 additions & 49 deletions src/occ_405/wof/wof.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,16 @@ void send_vfrt_to_pgpe( uint32_t i_vfrt_main_mem_addr )
break;
}

if( (i_vfrt_main_mem_addr == g_wof->curr_vfrt_main_mem_addr ) &&
// Check if PGPE explicitely requested a new vfrt
ocb_occflg_t occ_flags = {0};
occ_flags.value = in32(OCB_OCCFLG);

if( ((i_vfrt_main_mem_addr == g_wof->curr_vfrt_main_mem_addr ) &&
(g_wof->req_active_quad_update ==
g_wof->prev_req_active_quads) )
g_wof->prev_req_active_quads)) &&
(!occ_flags.fields.active_quad_update) )
{
// VFRT and requested active quads are unchanged. Skip
// VFRT and requested active quads are unchanged.
break;
}
// Either the Main memory address changed or req active quads changed
Expand Down Expand Up @@ -1547,6 +1552,8 @@ void set_clear_wof_disabled( uint8_t i_action,
void disable_wof( void )
{
errlHndl_t l_errl = NULL;
uint8_t l_prev_state = g_wof->wof_init_state;

// Disable wof on 405
g_wof->wof_init_state = WOF_DISABLED;

Expand All @@ -1556,66 +1563,74 @@ void disable_wof( void )
int user_data_rc = 0;
do
{
// Make sure IPC command is idle
if(async_request_is_idle(&G_wof_control_req.request))
if(l_prev_state >= WOF_CONTROL_ON_SENT_WAITING)
{

// Check to see if a previous wof control IPC message observed an error
if( g_wof->control_ipc_rc != 0 )
{
INTR_TRAC_ERR("Unknown error from wof control IPC message");
/** @
* @errortype
* @moduleid DISABLE_WOF
* @reasoncode GPE_REQUEST_RC_FAILURE
* @userdata1 rc - wof_control rc
* @userdata2 0
* @userdata4 OCC_NO_EXTENDED_RC
* @devdesc OCC Failure from sending wof control
*/
user_data_rc = g_wof->control_ipc_rc;
g_wof->control_ipc_rc = 0;
reasonCode = GPE_REQUEST_RC_FAILURE;
}
else
// Make sure IPC command is idle
if(async_request_is_idle(&G_wof_control_req.request))
{
// Set parameters for the GpeRequest
G_wof_control_parms.action = PGPE_ACTION_WOF_OFF;
user_data_rc = pgpe_request_schedule( &G_wof_control_req );

if( user_data_rc != 0 )
// Check to see if a previous wof control IPC message observed an error
if( g_wof->control_ipc_rc != 0 )
{
INTR_TRAC_ERR("Unknown error from wof control IPC message(disable)");
INTR_TRAC_ERR("Return Code = 0x%x", g_wof->control_ipc_rc);
/** @
* @errortype
* @moduleid DISABLE_WOF
* @reasoncode GPE_REQUEST_SCHEDULE_FAILURE
* @userdata1 rc - gpe_request_schedule return code
* @reasoncode GPE_REQUEST_RC_FAILURE
* @userdata1 rc - wof_control rc
* @userdata2 0
* @userdata4 OCC_NO_EXTENDED_RC
* @devdesc OCC Failed to schedule a GPE job for enabling wof
* @devdesc OCC Failure from sending wof control
*/
reasonCode = GPE_REQUEST_SCHEDULE_FAILURE;
INTR_TRAC_ERR("disable_wof() - Error when sending WOF Control"
" OFF IPC command! RC = %x", user_data_rc );
user_data_rc = g_wof->control_ipc_rc;
g_wof->control_ipc_rc = 0;
reasonCode = GPE_REQUEST_RC_FAILURE;
}
}
else
{
// Set parameters for the GpeRequest
G_wof_control_parms.action = PGPE_ACTION_WOF_OFF;
user_data_rc = pgpe_request_schedule( &G_wof_control_req );

if( user_data_rc != 0 )
{
l_errl = createErrl(
DISABLE_WOF,
reasonCode,
OCC_NO_EXTENDED_RC,
ERRL_SEV_PREDICTIVE,
NULL,
DEFAULT_TRACE_SIZE,
user_data_rc,
0);
if( user_data_rc != 0 )
{
/** @
* @errortype
* @moduleid DISABLE_WOF
* @reasoncode GPE_REQUEST_SCHEDULE_FAILURE
* @userdata1 rc - gpe_request_schedule return code
* @userdata2 0
* @userdata4 OCC_NO_EXTENDED_RC
* @devdesc OCC Failed to schedule a GPE job for enabling wof
*/
reasonCode = GPE_REQUEST_SCHEDULE_FAILURE;
INTR_TRAC_ERR("disable_wof() - Error when sending WOF Control"
" OFF IPC command! RC = %x", user_data_rc );
}
}

// commit the error log
commitErrl( &l_errl );
if( user_data_rc != 0 )
{
l_errl = createErrl(
DISABLE_WOF,
reasonCode,
OCC_NO_EXTENDED_RC,
ERRL_SEV_PREDICTIVE,
NULL,
DEFAULT_TRACE_SIZE,
user_data_rc,
0);

// commit the error log
commitErrl( &l_errl );
}
}
}
else
{
INTR_TRAC_IMP("WOF has not been enabled so no need to disable");
}
}while( 0 );
}

Expand Down Expand Up @@ -1644,7 +1659,8 @@ bool enable_wof( void )
// Check to see if a previous wof control IPC message observed an error
if( g_wof->control_ipc_rc != 0 )
{
INTR_TRAC_ERR("Unknown error from wof control IPC message");
INTR_TRAC_ERR("Unknown error from wof control IPC message(enable)");
INTR_TRAC_ERR("Return Code = 0x%X", g_wof->control_ipc_rc);
rc = g_wof->control_ipc_rc;
bit_to_set = WOF_RC_CONTROL_REQ_FAILURE;
g_wof->control_ipc_rc = 0;
Expand Down

0 comments on commit bf6e716

Please sign in to comment.