From af8b82e5326ac10f49eeaeab2cdca03c4c952278 Mon Sep 17 00:00:00 2001 From: Yue Du Date: Fri, 21 Jul 2017 11:01:47 -0500 Subject: STOP: Fix long delayed Phantom by dec wakeup in stop5 Change-Id: Ic1dee437a17c35ed9bd19894cfef9cf0c08eee02 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43434 Tested-by: Jenkins Server Reviewed-by: Michael S. Floyd Reviewed-by: BRIAN D. VICTOR Reviewed-by: Gregory S. Still --- .../sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c | 25 ++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c index df7c38f7..25986506 100644 --- a/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c +++ b/import/chips/p9/procedures/ppe_closed/sgpe/stop_gpe/p9_sgpe_stop_irq_handlers.c @@ -251,6 +251,7 @@ p9_sgpe_ipi3_low_handler(void* arg, PkIrqId irq) static void p9_sgpe_pig_type23_parser(const uint32_t type) { + uint32_t timeout = 0; uint32_t qloop = 0; uint32_t cloop = 0; uint32_t cstart = 0; @@ -395,16 +396,20 @@ p9_sgpe_pig_type23_parser(const uint32_t type) // request exit if (cpayload & TYPE2_PAYLOAD_EXIT_EVENT) { - if (!(scom_data.words.upper & BIT32(13))) + // phantom can be processed when WNS already handoff to cme by a different wakeup + // OR can be delayed long enough when WNS handoff back to sgpe by next cme entry + if ((!(scom_data.words.upper & BIT32(13))) || + (G_sgpe_stop_record.level[qloop][cloop] == 0)) { - if (cpayload == 0x400) + // type2 duplicate wakeup can happen due to manual PCWU vs other HW wakeup + if (type == 2) { - PK_TRACE_INF("WARNING: Ignore Phantom PCWU PIG \ + PK_TRACE_INF("WARNING: Ignore Phantom Type2 Wakeup PIG \ (already handoff cme by other wakeup"); } - else + else // otherwise PPM shouldnt send duplicate pig if wakeup is present { - PK_TRACE_INF("ERROR: Received Phantom Exit PIG \ + PK_TRACE_INF("ERROR: Received Phantom Type3 Wakeup PIG \ When Wakeup_notify_select = 0. HALT SGPE!"); PK_PANIC(SGPE_PIG_TYPE23_EXIT_WNS_CME); } @@ -439,7 +444,15 @@ p9_sgpe_pig_type23_parser(const uint32_t type) else if ((G_sgpe_stop_record.level[qloop][cloop] = (cpayload & TYPE2_PAYLOAD_STOP_LEVEL))) { - if (!(scom_data.words.upper & BIT32(13))) + timeout = 16; + + while((!(scom_data.words.upper & BIT32(13))) && timeout) + { + GPE_GETSCOM(GPE_SCOM_ADDR_CORE(CPPM_CPMMR, cindex), scom_data.value); + timeout--; + } + + if (!timeout) { PK_TRACE_ERR("ERROR: Received Phantom Entry PIG \ When Wakeup_notify_select = 0. HALT SGPE!"); -- cgit v1.2.3