Skip to content

Commit

Permalink
PGPE: Optrace fixes
Browse files Browse the repository at this point in the history
        Key_Cronus_Test=PM_REGRESS

Change-Id: Idf3bbbf54401a564ce48d94f96507c38ca238f10
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/79831
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Cronus HW CI <cronushw-ci+hostboot@us.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <prasadbgr@in.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
  • Loading branch information
rbatraAustinIBM authored and op-jenkins committed Jul 22, 2019
1 parent b707678 commit 9a22b25
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 40 deletions.
Expand Up @@ -160,7 +160,7 @@ void p9_pgpe_irq_handler_ocb_err()
{

G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) |
(G_pgpe_pstate_record.activeCores << 8);
(G_pgpe_pstate_record.activeCores >> 8);
G_pgpe_optrace_data.word[1] = (G_pgpe_pstate_record.psCurr.fields.glb << 24) |
(G_pgpe_pstate_record.extVrmCurr << 8) |
PGPE_OP_TRACE_OCC_HB_FAULT;
Expand Down Expand Up @@ -200,13 +200,14 @@ void p9_pgpe_irq_handler_sgpe_err()
out32(G_OCB_OISR0_CLR, BIT32(8));

//Optrace
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) |
(G_pgpe_pstate_record.activeCores << 8);
G_pgpe_optrace_data.word[1] = (G_pgpe_pstate_record.psCurr.fields.glb << 24) |
(G_pgpe_pstate_record.extVrmCurr << 8) |
PGPE_OP_TRACE_SGPE_FAULT;
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) |
(G_pgpe_pstate_record.activeCores >> 8);
G_pgpe_optrace_data.word[1] = (G_pgpe_pstate_record.psCurr.fields.glb << 24) |
(G_pgpe_pstate_record.extVrmCurr << 8) |
PGPE_OP_TRACE_SGPE_FAULT;
p9_pgpe_optrace(SEVERE_FAULT_DETECTED);


//HALT if DEBUG_HALT is set
PGPE_OPTIONAL_TRACE_AND_PANIC(PGPE_GPE3_ERROR);

Expand Down Expand Up @@ -241,7 +242,7 @@ void p9_pgpe_irq_handler_pvref_err()

//Optrace
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) |
(G_pgpe_pstate_record.activeCores << 8);
(G_pgpe_pstate_record.activeCores >> 8);
G_pgpe_optrace_data.word[1] = (G_pgpe_pstate_record.psCurr.fields.glb << 24) |
(G_pgpe_pstate_record.extVrmCurr << 8) |
PGPE_OP_TRACE_PVREF_FAULT;
Expand Down Expand Up @@ -286,7 +287,7 @@ void p9_pgpe_irq_handler_system_xstop(void* arg, PkIrqId irq)

//Optrace
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) |
(G_pgpe_pstate_record.activeCores << 8);
(G_pgpe_pstate_record.activeCores >> 8);
G_pgpe_optrace_data.word[1] = (G_pgpe_pstate_record.psCurr.fields.glb << 24) |
(G_pgpe_pstate_record.extVrmCurr << 8) |
PGPE_OP_TRACE_SYS_XSTOP;
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
/* COPYRIGHT 2016,2018 */
/* COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -74,7 +74,7 @@ void p9_pgpe_optrace(uint32_t mark)
if(G_lastDisable) //Place start trace mark at when first enabled
{
G_lastDisable = 0;
p9_pgpe_optrace(ACK_START_TRACE);
p9_pgpe_optrace(ACK_START_TRACE); //Note, recursive function call
}

uint32_t word_count = ((mark >> 4) & 0x3) + 1;
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HCODE Project */
/* */
/* COPYRIGHT 2016,2018 */
/* COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -28,12 +28,12 @@

enum PGPE_OP_TRACE_ENCODES
{
START_STOP_IPC = 0,
START_STOP_FLAG = 1,
PSTATE_STOP = 0,
PSTATE_START = 1,

//Without Timestamps
WOF_CALC_DONE = 0x11,
AUCTION_DONE = 0x10,
WOF_CALC_DONE = 0x11,
FIT_TB_RESYNC = 0x02,

//ACKs
Expand Down Expand Up @@ -68,14 +68,18 @@ enum PGPE_OP_TRACE_ENCODES
PRC_CORES_ACTV = 0x5A,
PRC_QUAD_ACTV = 0x5B,
FIT_TB_SYNC = 0x5C,
SEVERE_FAULT_DETECTED = 0x5D,
SYSTEM_XSTOP = 0x4D,
SEVERE_FAULT_DETECTED = 0x6D,
PRC_PM_SUSP = 0x4E,
PRC_SAFE_MODE = 0x4F,
PRC_SAFE_MODE = 0x5F,

//Debug Markers
PROLONGED_DROOP_EVENT = 0x9E,
PROLONGED_DROOP_RESOLVED = 0xAF
PROLONGED_DROOP_RESOLVED = 0xAF,

//PMCR OWNER
OP_PMCR_HOST = 0x0,
OP_PMCR_OCC = 0x1,
OP_PMCR_CHAR = 0x2,
};

enum PGPE_OP_TRACE_SEVERE_FAULTS
Expand Down
Expand Up @@ -1237,10 +1237,6 @@ void p9_pgpe_pstate_stop()
out32(G_OCB_OCCS2, occScr2);
G_pgpe_pstate_record.pstatesStatus = PSTATE_STOPPED;

G_pgpe_optrace_data.word[0] = (START_STOP_FLAG << 24) | (G_pgpe_pstate_record.psComputed.fields.glb << 16)
| (in32(G_OCB_QCSR) >> 16);
p9_pgpe_optrace(PRC_START_STOP);

PK_TRACE_DBG("PSS: Stop Done");
}

Expand Down Expand Up @@ -1665,15 +1661,15 @@ void p9_pgpe_pstate_safe_mode()
pgpe_db0_glb_bcast_t db0;

// Generate OPTRACE Process Start
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) | (G_pgpe_pstate_record.psComputed.fields.glb <<
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) | (G_pgpe_pstate_record.psCurr.fields.glb <<
16)
| (G_pgpe_pstate_record.safePstate << 8) |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_OCC] ? 0x20 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_SGPE] ? 0x10 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_CME] ? 0x08 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_PVREF] ? 0x04 : 0 |
safemode ? 0x2 : 0 |
suspend ? 0x1 : 0;
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_PVREF] ? 0x20 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_CME] ? 0x10 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_SGPE] ? 0x8 : 0 |
G_pgpe_pstate_record.severeFault[SAFE_MODE_FAULT_OCC] ? 0x4 : 0 |
suspend ? 0x2 : 0 |
safemode ? 0x1 : 0;

p9_pgpe_optrace(PRC_SAFE_MODE);

Expand Down Expand Up @@ -1870,6 +1866,7 @@ void p9_pgpe_pstate_handle_pending_occ_ack_on_fault()
args_wof_vfrt->msg_cb.rc = PGPE_RC_PM_COMPLEX_SUSPEND_SAFE_MODE;
G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_WOF_VFRT].pending_ack = 0;
ipc_send_rsp(G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_WOF_VFRT].cmd, IPC_RC_SUCCESS);
p9_pgpe_optrace(ACK_WOF_VFRT);
}
}

Expand All @@ -1895,6 +1892,7 @@ void p9_pgpe_pstate_handle_pending_sgpe_ack_on_fault()
args->fields.return_code = IPC_SGPE_PGPE_RC_SUCCESS;
G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_SGPE_ACTIVE_QUADS_UPDT].pending_ack = 0;
ipc_send_rsp(G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_SGPE_ACTIVE_QUADS_UPDT].cmd, IPC_RC_SUCCESS);
p9_pgpe_optrace(ACK_QUAD_ACTV);
}

//ACK back to SGPE with "IPC_SGPE_PGPE_RC_SUCCESS"
Expand All @@ -1916,6 +1914,7 @@ void p9_pgpe_pstate_handle_pending_sgpe_ack_on_fault()
G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_SGPE_ACTIVE_CORES_UPDT].pending_ack = 0;
ipc_send_rsp(G_pgpe_pstate_record.ipcPendTbl[IPC_PEND_SGPE_ACTIVE_CORES_UPDT].cmd, IPC_RC_SUCCESS);
args->fields.return_code = IPC_SGPE_PGPE_RC_SUCCESS;
p9_pgpe_optrace(ACK_CORES_ACTV);
}

}
Expand Down Expand Up @@ -2527,8 +2526,8 @@ inline void p9_pgpe_droop_unthrottle()
//5. Write PK Trace and Optrace record that the Prolonged Throttle workaround was removed,
//including the Total Retry Count and the most recent bit vector of Quads that provided the NACK(s) .
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.quadsNACKed << 24) |
(G_pgpe_pstate_record.activeCores);
G_pgpe_optrace_data.word[0] = G_pgpe_pstate_record.cntNACKs;
(G_pgpe_pstate_record.activeCores >> 8);
G_pgpe_optrace_data.word[1] = G_pgpe_pstate_record.cntNACKs;
p9_pgpe_optrace(PROLONGED_DROOP_RESOLVED);

PK_TRACE_INF("DTH: Droop Unthrottle Done");
Expand Down
Expand Up @@ -76,8 +76,10 @@ void p9_pgpe_thread_actuate_pstates(void* arg)
//Mask all external interrupts. Timers are still enabled
pk_irq_sub_critical_enter(&ctx);
p9_pgpe_pstate_start(PSTATE_START_OCC_FLAG);
G_pgpe_optrace_data.word[0] = (START_STOP_FLAG << 24) | (G_pgpe_pstate_record.psComputed.fields.glb << 16) | (in32(
G_OCB_QCSR) >> 16);
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.pmcrOwner << 25) |
(PSTATE_START << 24) |
(G_pgpe_pstate_record.psCurr.fields.glb << 16) |
(in32(G_OCB_QCSR) >> 16);
p9_pgpe_optrace(PRC_START_STOP);
pk_irq_sub_critical_exit(&ctx);
}
Expand Down
Expand Up @@ -483,9 +483,10 @@ inline void p9_pgpe_process_start_stop()
{
PK_TRACE_DBG("START_STOP: Imm");
args->msg_cb.rc = PGPE_RC_SUCCESS;
G_pgpe_optrace_data.word[0] = (START_STOP_IPC << 24) |
(G_pgpe_pstate_record.psComputed.fields.glb << 16) |
(in32(G_OCB_QCSR) >> 16);
G_pgpe_optrace_data.word[0] = (args->pmcr_owner << 25 ) |
(PSTATE_START << 24) |
(G_pgpe_pstate_record.psCurr.fields.glb << 16) |
(in32(G_OCB_QCSR) >> 16);
p9_pgpe_optrace(PRC_START_STOP);

}
Expand Down Expand Up @@ -545,7 +546,7 @@ inline void p9_pgpe_process_start_stop()
}

G_pgpe_optrace_data.word[0] = (args->pmcr_owner << 25 ) |
(1 << 24) |
(PSTATE_START << 24) |
(G_pgpe_pstate_record.psCurr.fields.glb << 16) |
(in32(G_OCB_QCSR) >> 16);
p9_pgpe_optrace(PRC_START_STOP);
Expand Down Expand Up @@ -1045,7 +1046,6 @@ inline void p9_pgpe_process_set_pmcr_req()
if(G_pgpe_header_data->g_pgpe_flags & PGPE_FLAG_OCC_IPC_IMMEDIATE_MODE)
{
PK_TRACE_DBG("PTH: Set PMCR Imme");
p9_pgpe_optrace(PRC_SET_PMCR);
args->msg_cb.rc = PGPE_RC_SUCCESS;
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.psTarget.fields.quads[0] << 24) |
(G_pgpe_pstate_record.psTarget.fields.quads[1] << 16) |
Expand Down Expand Up @@ -1185,8 +1185,9 @@ inline void p9_pgpe_process_registration()
PK_TRACE_INF("PTH: Quad %d Registration Processing. qActive=0x%x cActive=0x%x", q, G_pgpe_pstate_record.activeQuads,
G_pgpe_pstate_record.activeDB);

G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24) | (G_pgpe_pstate_record.psCurr.fields.glb << 16)
| (in32(G_OCB_QCSR) >> 16);
G_pgpe_optrace_data.word[0] = (G_pgpe_pstate_record.activeQuads << 24)
| (G_pgpe_pstate_record.psCurr.fields.glb << 16)
| (in32(G_OCB_QCSR) >> 16);
p9_pgpe_optrace(PRC_PCB_T4);
}
}
Expand Down

0 comments on commit 9a22b25

Please sign in to comment.