Skip to content

Commit

Permalink
STOP: FIX phantom wakeup vs. wakeup_notify_select
Browse files Browse the repository at this point in the history
1) sgpe check type2 and 3 on the same core
2) cme check if notify is truely set
3) sgpe check if notify is truely set during stop8 entry
4) FIX phantom wakeup vs. wakeup_notify_select
5) so 4) isnt good enough as phantom can be noticed
   when notify = 1 or 0 (good type checker caught this)
   instead of using truth table to completely
   handle/detect unwanted cases.

Change-Id: I513772fcba548e1ba96c7108f52999a4e9d74f52
Original-Change-Id: I3df8326260ba505db7efb3bdee17cc8908bd13fc
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/37975
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: ASHISH A. MORE <ashish.more@in.ibm.com>
Reviewed-by: Brian T. Vanderpool <vanderp@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
  • Loading branch information
davidduyue authored and op-jenkins committed Aug 22, 2018
1 parent e3f788c commit c2290bc
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

extern CmeStopRecord G_cme_stop_record;


void prepare_for_ramming (uint32_t core)
{
uint64_t scom_data;
Expand Down Expand Up @@ -1166,6 +1165,29 @@ p9_cme_stop_entry()
scom_data.words.upper = SSH_ACT_LV5_COMPLETE;
CME_PUTSCOM(PPM_SSHSRC, core, scom_data.value);

if (core & CME_MASK_C0)
{
CME_GETSCOM(CPPM_CPMMR, CME_MASK_C0, CME_SCOM_AND, scom_data.value);

if ((scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR: C0 notify was already set?");
pk_halt();

}
}

if (core & CME_MASK_C1)
{
CME_GETSCOM(CPPM_CPMMR, CME_MASK_C1, CME_SCOM_AND, scom_data.value);

if ((scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR: C1 notify was already set?");
pk_halt();
}
}

PK_TRACE("Send PCB interrupt per core via PIG, select irq type via CPMMR[10]");

for (core_mask = 2; core_mask; core_mask--)
Expand All @@ -1186,15 +1208,39 @@ p9_cme_stop_entry()
}

pig.fields.req_intr_payload = G_cme_stop_record.req_level[core_index];
PKTRACE("PIG PUTSCOM core_mask[%d] value %08X", core_mask, (pig.value >> 32));
CME_PUTSCOM(PPM_PIG, core_mask, pig.value);
G_cme_stop_record.core_stopgpe |= core;
G_cme_stop_record.act_level[core_index] = STOP_LEVEL_5;
}
}

PK_TRACE("Switch PPM wakeup to STOP-GPE via CPMMR[13]");
PKTRACE("Switch Core%d PPM wakeup to STOP-GPE via CPMMR[13]", core);
CME_PUTSCOM(CPPM_CPMMR_OR, core, BIT64(13));

if (core & CME_MASK_C0)
{
CME_GETSCOM(CPPM_CPMMR, CME_MASK_C0, CME_SCOM_AND, scom_data.value);

if (!(scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR: C0 notify fail to set");
pk_halt();

}
}

if (core & CME_MASK_C1)
{
CME_GETSCOM(CPPM_CPMMR, CME_MASK_C1, CME_SCOM_AND, scom_data.value);

if (!(scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR: C1 notify fail to set");
pk_halt();
}
}

PK_TRACE_INF("SE5.B: Handed off to SGPE");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ p9_sgpe_stop_entry()
continue;
}

GPE_GETSCOM(GPE_SCOM_ADDR_CORE(CPPM_CPMMR,
((qloop << 2) + cloop)), scom_data.value);

if (!(scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR.B: core[%d] notify fail to set", ((qloop << 2) + cloop));
pk_halt();
}

PK_TRACE("Update STOP history on core[%d]: in transition of entry",
((qloop << 2) + cloop));
scom_data.words.lower = 0;
Expand Down Expand Up @@ -463,6 +472,15 @@ p9_sgpe_stop_entry()
continue;
}

GPE_GETSCOM(GPE_SCOM_ADDR_CORE(CPPM_CPMMR,
((qloop << 2) + cloop)), scom_data.value);

if (!(scom_data.words.upper & BIT32(13)))
{
PKTRACE("ERROR.C: core[%d] notify fail to set", ((qloop << 2) + cloop));
pk_halt();
}

// request levle already set by CME
// shift by 2 == times 4, which is cores per quad
PK_TRACE("Update STOP history on core[%d]: in stop level 8",
Expand Down

0 comments on commit c2290bc

Please sign in to comment.