Skip to content

Commit 793c77e

Browse files
rbatraAustinIBMop-jenkins
authored andcommitted
PM: Fix Clip Update Timeout
Key_Cronus_Test=PM_REGRESS Change-Id: Ia943cdd3bb646104bfd686356cd3f23bc5876a7d CQ: SW452077 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/74964 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
1 parent 2f40a0b commit 793c77e

File tree

3 files changed

+87
-16
lines changed

3 files changed

+87
-16
lines changed

import/chips/p9/common/pmlib/include/pstate_pgpe_cme_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2018 */
8+
/* COPYRIGHT 2016,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -113,6 +113,7 @@ enum MESSAGE_ID_DB3
113113
MSGID_DB3_DISABLE_SGPE_HANDOFF = 0x04,
114114
MSGID_DB3_SUSPEND_STOP_ENTRY = 0x05,
115115
MSGID_DB3_UNSUSPEND_STOP_ENTRY = 0x06,
116+
MSGID_DB3_CLIP_BROADCAST = 0x07,
116117
MSGID_DB3_IMMEDIATE_HALT = 0xF1,
117118
MSGID_DB3_RESTORE_STATE_AND_HALT = 0xF2,
118119
};

import/chips/p9/procedures/ppe_closed/cme/pstate_cme/p9_cme_thread_db.c

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/* */
66
/* OpenPOWER HCODE Project */
77
/* */
8-
/* COPYRIGHT 2016,2018 */
8+
/* COPYRIGHT 2016,2019 */
99
/* [+] International Business Machines Corp. */
1010
/* */
1111
/* */
@@ -297,6 +297,75 @@ void p9_cme_pstate_db3_handler(void)
297297
}
298298

299299
}
300+
else if (db3.fields.cme_message_numbern == MSGID_DB3_CLIP_BROADCAST)
301+
{
302+
PK_TRACE_INF("PSTATE: DB3 Clip Enter");
303+
304+
uint32_t dbQuadInfo, dbBit8_15;
305+
cppm_cmedb0_t dbData;
306+
CME_GETSCOM(CPPM_CMEDB0, G_cme_pstate_record.firstGoodCoreMask, dbData.value);
307+
dbBit8_15 = (dbData.value & BITS64(8, 8)) >> SHIFT64(15);
308+
dbQuadInfo = (dbData.value >> (in32(G_CME_LCL_SRTCH0) &
309+
(BITS32(CME_SCRATCH_LOCAL_PSTATE_IDX_START, CME_SCRATCH_LOCAL_PSTATE_IDX_LENGTH)
310+
))) & 0xFF;
311+
312+
//Quad Manager
313+
if(G_cme_pstate_record.qmFlag)
314+
{
315+
//Sync up with sibling CME
316+
p9_cme_pstate_notify_sib(INTERCME_DIRECT_IN2);
317+
318+
if (dbBit8_15 == DB0_CLIP_BCAST_TYPE_PMIN)
319+
{
320+
G_cme_pstate_record.pmin = dbQuadInfo;
321+
}
322+
else
323+
{
324+
G_cme_pstate_record.pmax = dbQuadInfo;
325+
}
326+
327+
PK_TRACE_INF("PSTATE: Pmin=0x%x,Pmax=0x%x", G_cme_pstate_record.pmin, G_cme_pstate_record.pmax);
328+
329+
330+
p9_cme_pstate_pmsr_updt();
331+
332+
//Sync up with the sibling CME before ACKing back to PGPE
333+
p9_cme_pstate_notify_sib(INTERCME_DIRECT_IN2); //Notify sibling
334+
335+
//Send type4(ack doorbell)
336+
send_ack_to_pgpe(MSGID_PCB_TYPE4_ACK_PSTATE_PROTO_ACK);
337+
338+
}
339+
//On Sibling, poll on intercme_in2 direct msg.
340+
else
341+
{
342+
//Wait to receive a notify from Quad Manager
343+
//and then ACK back to quad manager
344+
while(!(in32_sh(CME_LCL_EISR) & BIT64SH(39)));
345+
346+
intercme_direct(INTERCME_DIRECT_IN2, INTERCME_DIRECT_ACK, 0);
347+
348+
if (dbBit8_15 == DB0_CLIP_BCAST_TYPE_PMIN)
349+
{
350+
G_cme_pstate_record.pmin = dbQuadInfo;
351+
}
352+
else
353+
{
354+
G_cme_pstate_record.pmax = dbQuadInfo;
355+
}
356+
357+
p9_cme_pstate_pmsr_updt();
358+
359+
//Wait to receive a notify from Quad Manager
360+
//and then ACK back to quad manager
361+
while(!(in32_sh(CME_LCL_EISR) & BIT64SH(39)));
362+
363+
intercme_direct(INTERCME_DIRECT_IN2, INTERCME_DIRECT_ACK, 0);
364+
}
365+
366+
PK_TRACE_INF("PSTATE: DB3 Clip Exit");
367+
}
368+
300369
else
301370
{
302371
//\todo Will be done as part of 41947

import/chips/p9/procedures/ppe_closed/pgpe/pstate_gpe/p9_pgpe_pstate.c

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,18 +1138,13 @@ void p9_pgpe_pstate_stop()
11381138
PK_TRACE_DBG("PSS: Stop Done");
11391139
}
11401140

1141-
//
1142-
// p9_pgpe_pstate_clip_bcast
1143-
//
1144-
// Wrapper function for sending Pstate Clip Bcast DB0 to CMEs
11451141
void p9_pgpe_pstate_clip_bcast(uint32_t clip_bcast_type)
11461142
{
11471143
PK_TRACE_DBG("CLB: Clip Bcast");
11481144
pgpe_db0_clip_bcast_t db0;
11491145
db0.value = 0;
1150-
db0.fields.msg_id = MSGID_DB0_CLIP_BROADCAST;
1146+
db0.fields.msg_id = MSGID_DB0_DB3_PAYLOAD;
11511147
db0.fields.clip_type = clip_bcast_type;
1152-
db0_parms_t p;
11531148

11541149
//Note that we store PMIN as psClipMax(which is lower Pstate, but higher numbered Pstate)
11551150
if (clip_bcast_type == DB0_CLIP_BCAST_TYPE_PMIN)
@@ -1171,15 +1166,21 @@ void p9_pgpe_pstate_clip_bcast(uint32_t clip_bcast_type)
11711166
db0.fields.quad5_clip = G_pgpe_pstate_record.psClipMin[5];
11721167
}
11731168

1174-
p.db0val = db0.value;
1175-
p.type = PGPE_DB0_TYPE_UNICAST;
1176-
p.targetCores = G_pgpe_pstate_record.activeDB;
1177-
p.waitForAcks = PGPE_DB_ACK_WAIT_CME;
1178-
p.expectedAckFrom = G_pgpe_pstate_record.activeQuads;
1179-
p.expectedAckValue = MSGID_PCB_TYPE4_ACK_PSTATE_PROTO_ACK;
1180-
p9_pgpe_send_db0(p);
1169+
//Write DB0, but with top-byte = 0. This way DB0 interrupt doesn't happen, but
1170+
//we still send CME the necessary data. CME will read this inside the DB3 interrupt
1171+
//which we write next
1172+
db3_parms_t p = { MSGID_DB3_CLIP_BROADCAST,
1173+
db0.value,
1174+
PGPE_DB3_WRITE_DB0,
1175+
G_pgpe_pstate_record.activeDB,
1176+
PGPE_DB_ACK_WAIT_CME,
1177+
G_pgpe_pstate_record.activeQuads,
1178+
MSGID_PCB_TYPE4_ACK_PSTATE_PROTO_ACK,
1179+
PGPE_DB3_SKIP_CHECK_NACKS
1180+
};
1181+
p.db3val = (uint64_t)(MSGID_DB3_CLIP_BROADCAST) << 56;
1182+
p9_pgpe_send_db3(p);
11811183
}
1182-
11831184
//
11841185
// p9_pgpe_pstate_wof_ctrl
11851186
//

0 commit comments

Comments
 (0)