diff options
author | Rahul Batra <rbatra@us.ibm.com> | 2017-12-11 17:16:21 -0600 |
---|---|---|
committer | Joshua Hunsberger <jahunsbe@us.ibm.com> | 2018-02-01 16:20:21 -0600 |
commit | 3d2e2dd9dcea3547d427496ff838cd4733d06e85 (patch) | |
tree | e7b29cdedb3e76261b8d8a66dbf73089bdc139b9 /import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c | |
parent | d419fbd67b03f365b343a8ef39f8448de8f6d2f6 (diff) | |
download | talos-hcode-3d2e2dd9dcea3547d427496ff838cd4733d06e85.tar.gz talos-hcode-3d2e2dd9dcea3547d427496ff838cd4733d06e85.zip |
PGPE: Fix FIT and actuation step conflict
Key_Cronus_Test=PM_REGRESS
Change-Id: If59fa83c2a22a312f6bb6676b5570bae7774ee72
Original-Change-Id: I8cf51a4e044c70871c5f74a5d3a6ecfe64dafd47
CQ: SW411044
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50779
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Michael S. Floyd <mfloyd@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: YUE DU <daviddu@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Diffstat (limited to 'import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c')
-rw-r--r-- | import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c index 67a29571..541ee0ba 100644 --- a/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c +++ b/import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_thread_actuate_pstates.c @@ -108,14 +108,15 @@ void p9_pgpe_thread_actuate_pstates(void* arg) //Actuate step(if needed) if(p9_pgpe_pstate_at_target() == 0) { - //We check that pstates are active after entering critical section - //It's possible that some IPC which is processed by PROCESS THREAD - //has updated the PstatesState to a !PSTATE_ACTIVE state pk_irq_sub_critical_enter(&ctx); + //We check that pstates are active after entering critical section + //It's possible that some IPC or even FIT before we set actuating=1 + //has updated the PstatesState to a !PSTATE_ACTIVE state if (G_pgpe_pstate_record.pstatesStatus == PSTATE_ACTIVE) { p9_pgpe_pstate_do_step(); + } pk_irq_sub_critical_exit(&ctx); @@ -130,6 +131,8 @@ void p9_pgpe_thread_actuate_pstates(void* arg) //Enter sub-critical section //Process any pending ACKs in sub-critical section. Otherwise, it's possible that the inrange check //below is interrupted, and new clips are calculated + //Also, we enter sub-critical section only if some action is pending. If, move this above the + //if statement, then we will unnessarily enter/exit sub-critical section. pk_irq_sub_critical_enter(&ctx); inRange = 1; @@ -184,7 +187,6 @@ void p9_pgpe_thread_actuate_pstates(void* arg) G_pgpe_pstate_record.pendingPmaxClipBcast = 0; } - ipc_async_cmd_t* async_cmd = (ipc_async_cmd_t*)G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_CLIP_UPDT].cmd; ipcmsg_clip_update_t* args = (ipcmsg_clip_update_t*)async_cmd->cmd_data; args->msg_cb.rc = PGPE_RC_SUCCESS; @@ -262,39 +264,37 @@ void p9_pgpe_thread_actuate_pstates(void* arg) restore_irq = 0; pk_irq_vec_restore(&ctx); } + }//End PstateStatus = PSTATE_ACTIVE loop + + + //Do processing inside sub-critical section, so as to not get conflict + //with external interrupts + pk_irq_sub_critical_enter(&ctx); + + PK_TRACE_DBG("ACT_TH: PSTATE_ACTIVE loop end)"); + + //PSTATE_SAFE_MODE_PENDING is set if, pstates are active and PM_COMPLEX_SUSPEND requested. + //OR, if SAFE MODE is requested + if (G_pgpe_pstate_record.pstatesStatus == PSTATE_SAFE_MODE_PENDING) + { + p9_pgpe_pstate_safe_mode(); } - if (G_pgpe_pstate_record.pstatesStatus == PSTATE_PM_SUSPEND_PENDING - || G_pgpe_pstate_record.pstatesStatus == PSTATE_SAFE_MODE) + //PSTATE_PM_SUSPEND_PENDING is directly set if PM_COMPLEX_SUSPEND is requested + //and pstates aren't active. Or, if PM_COMPLEX_SUSPEND is requested and pstates + //are active, and system has moved to Psafe(done by p9_pgpe_pstate_safe_mode() above) + //This check must come after the possible p9_pgpe_pstate_safe_mode() call above + if (G_pgpe_pstate_record.pstatesStatus == PSTATE_PM_SUSPEND_PENDING) { - //Actuate to PSAFE Pstate - while (p9_pgpe_pstate_at_target() == 0) - { - pk_irq_sub_critical_enter(&ctx); - p9_pgpe_pstate_do_step(); - pk_irq_sub_critical_exit(&ctx); - } + p9_pgpe_pstate_send_suspend_stop(); + } - //Send SAFE Mode Bcast to all CMEs - pgpe_db0_safe_mode_bcast_t db0_sm_bcast; - db0_sm_bcast.value = 0; - db0_sm_bcast.fields.msg_id = MSGID_DB0_SAFE_MODE_BROADCAST; - p9_pgpe_send_db0(db0_sm_bcast.value, - G_pgpe_pstate_record.activeCores, - PGPE_DB0_UNICAST, - PGPE_DB0_ACK_WAIT_CME, - G_pgpe_pstate_record.activeQuads); - - if (G_pgpe_pstate_record.pstatesStatus == PSTATE_PM_SUSPEND_PENDING) - { - p9_pgpe_pstate_send_suspend_stop(); //Notify SGPE - } - else if (G_pgpe_pstate_record.pstatesStatus == PSTATE_SAFE_MODE) - { - uint32_t occScr2 = in32(OCB_OCCS2); - occScr2 |= BIT32(PGPE_SAFE_MODE_ACTIVE); - out32(OCB_OCCS2, occScr2); - } + if (G_pgpe_pstate_record.pstatesStatus == PSTATE_STOP_PENDING) + { + p9_pgpe_pstate_stop(); } + + pk_irq_sub_critical_exit(&ctx); + }//Thread loop } |