Skip to content

Commit bf6e716

Browse files
committed
Look at OCCFLG[30] to see if PGPE needs a new VFRT
-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>
1 parent 919b789 commit bf6e716

File tree

2 files changed

+73
-50
lines changed

2 files changed

+73
-50
lines changed

src/occ_405/cmdh/cmdh_fsp_cmds_datacnfg.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER OnChipController Project */
77
/* */
8-
/* Contributors Listed Below - COPYRIGHT 2011,2017 */
8+
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -1771,6 +1771,13 @@ errlHndl_t data_store_sys_config(const cmdh_fsp_cmd_t * i_cmd_ptr,
17711771
G_sysConfigData.system_type.byte, G_sysConfigData.backplane_huid, G_sysConfigData.apss_huid,
17721772
G_sysConfigData.proc_huid);
17731773

1774+
// Check to see if we have to disable WOF due to no mode set yet on PowerVM
1775+
if( !G_sysConfigData.system_type.kvm &&
1776+
(CURRENT_MODE() == OCC_MODE_NOCHANGE) )
1777+
{
1778+
set_clear_wof_disabled(SET, WOF_RC_MODE_NO_SUPPORT_MASK);
1779+
}
1780+
17741781
//Write core temp and freq sensor ids
17751782
//Core Temp and Freq sensors are always in sequence in the table
17761783
for (l_coreIndex = 0; l_coreIndex < MAX_CORES; l_coreIndex++)

src/occ_405/wof/wof.c

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -659,11 +659,16 @@ void send_vfrt_to_pgpe( uint32_t i_vfrt_main_mem_addr )
659659
break;
660660
}
661661

662-
if( (i_vfrt_main_mem_addr == g_wof->curr_vfrt_main_mem_addr ) &&
662+
// Check if PGPE explicitely requested a new vfrt
663+
ocb_occflg_t occ_flags = {0};
664+
occ_flags.value = in32(OCB_OCCFLG);
665+
666+
if( ((i_vfrt_main_mem_addr == g_wof->curr_vfrt_main_mem_addr ) &&
663667
(g_wof->req_active_quad_update ==
664-
g_wof->prev_req_active_quads) )
668+
g_wof->prev_req_active_quads)) &&
669+
(!occ_flags.fields.active_quad_update) )
665670
{
666-
// VFRT and requested active quads are unchanged. Skip
671+
// VFRT and requested active quads are unchanged.
667672
break;
668673
}
669674
// Either the Main memory address changed or req active quads changed
@@ -1547,6 +1552,8 @@ void set_clear_wof_disabled( uint8_t i_action,
15471552
void disable_wof( void )
15481553
{
15491554
errlHndl_t l_errl = NULL;
1555+
uint8_t l_prev_state = g_wof->wof_init_state;
1556+
15501557
// Disable wof on 405
15511558
g_wof->wof_init_state = WOF_DISABLED;
15521559

@@ -1556,66 +1563,74 @@ void disable_wof( void )
15561563
int user_data_rc = 0;
15571564
do
15581565
{
1559-
// Make sure IPC command is idle
1560-
if(async_request_is_idle(&G_wof_control_req.request))
1566+
if(l_prev_state >= WOF_CONTROL_ON_SENT_WAITING)
15611567
{
1562-
1563-
// Check to see if a previous wof control IPC message observed an error
1564-
if( g_wof->control_ipc_rc != 0 )
1565-
{
1566-
INTR_TRAC_ERR("Unknown error from wof control IPC message");
1567-
/** @
1568-
* @errortype
1569-
* @moduleid DISABLE_WOF
1570-
* @reasoncode GPE_REQUEST_RC_FAILURE
1571-
* @userdata1 rc - wof_control rc
1572-
* @userdata2 0
1573-
* @userdata4 OCC_NO_EXTENDED_RC
1574-
* @devdesc OCC Failure from sending wof control
1575-
*/
1576-
user_data_rc = g_wof->control_ipc_rc;
1577-
g_wof->control_ipc_rc = 0;
1578-
reasonCode = GPE_REQUEST_RC_FAILURE;
1579-
}
1580-
else
1568+
// Make sure IPC command is idle
1569+
if(async_request_is_idle(&G_wof_control_req.request))
15811570
{
1582-
// Set parameters for the GpeRequest
1583-
G_wof_control_parms.action = PGPE_ACTION_WOF_OFF;
1584-
user_data_rc = pgpe_request_schedule( &G_wof_control_req );
15851571

1586-
if( user_data_rc != 0 )
1572+
// Check to see if a previous wof control IPC message observed an error
1573+
if( g_wof->control_ipc_rc != 0 )
15871574
{
1575+
INTR_TRAC_ERR("Unknown error from wof control IPC message(disable)");
1576+
INTR_TRAC_ERR("Return Code = 0x%x", g_wof->control_ipc_rc);
15881577
/** @
15891578
* @errortype
15901579
* @moduleid DISABLE_WOF
1591-
* @reasoncode GPE_REQUEST_SCHEDULE_FAILURE
1592-
* @userdata1 rc - gpe_request_schedule return code
1580+
* @reasoncode GPE_REQUEST_RC_FAILURE
1581+
* @userdata1 rc - wof_control rc
15931582
* @userdata2 0
15941583
* @userdata4 OCC_NO_EXTENDED_RC
1595-
* @devdesc OCC Failed to schedule a GPE job for enabling wof
1584+
* @devdesc OCC Failure from sending wof control
15961585
*/
1597-
reasonCode = GPE_REQUEST_SCHEDULE_FAILURE;
1598-
INTR_TRAC_ERR("disable_wof() - Error when sending WOF Control"
1599-
" OFF IPC command! RC = %x", user_data_rc );
1586+
user_data_rc = g_wof->control_ipc_rc;
1587+
g_wof->control_ipc_rc = 0;
1588+
reasonCode = GPE_REQUEST_RC_FAILURE;
16001589
}
1601-
}
1590+
else
1591+
{
1592+
// Set parameters for the GpeRequest
1593+
G_wof_control_parms.action = PGPE_ACTION_WOF_OFF;
1594+
user_data_rc = pgpe_request_schedule( &G_wof_control_req );
16021595

1603-
if( user_data_rc != 0 )
1604-
{
1605-
l_errl = createErrl(
1606-
DISABLE_WOF,
1607-
reasonCode,
1608-
OCC_NO_EXTENDED_RC,
1609-
ERRL_SEV_PREDICTIVE,
1610-
NULL,
1611-
DEFAULT_TRACE_SIZE,
1612-
user_data_rc,
1613-
0);
1596+
if( user_data_rc != 0 )
1597+
{
1598+
/** @
1599+
* @errortype
1600+
* @moduleid DISABLE_WOF
1601+
* @reasoncode GPE_REQUEST_SCHEDULE_FAILURE
1602+
* @userdata1 rc - gpe_request_schedule return code
1603+
* @userdata2 0
1604+
* @userdata4 OCC_NO_EXTENDED_RC
1605+
* @devdesc OCC Failed to schedule a GPE job for enabling wof
1606+
*/
1607+
reasonCode = GPE_REQUEST_SCHEDULE_FAILURE;
1608+
INTR_TRAC_ERR("disable_wof() - Error when sending WOF Control"
1609+
" OFF IPC command! RC = %x", user_data_rc );
1610+
}
1611+
}
16141612

1615-
// commit the error log
1616-
commitErrl( &l_errl );
1613+
if( user_data_rc != 0 )
1614+
{
1615+
l_errl = createErrl(
1616+
DISABLE_WOF,
1617+
reasonCode,
1618+
OCC_NO_EXTENDED_RC,
1619+
ERRL_SEV_PREDICTIVE,
1620+
NULL,
1621+
DEFAULT_TRACE_SIZE,
1622+
user_data_rc,
1623+
0);
1624+
1625+
// commit the error log
1626+
commitErrl( &l_errl );
1627+
}
16171628
}
16181629
}
1630+
else
1631+
{
1632+
INTR_TRAC_IMP("WOF has not been enabled so no need to disable");
1633+
}
16191634
}while( 0 );
16201635
}
16211636

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

0 commit comments

Comments
 (0)