summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio/sbe_fifodd.C
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2016-06-14 13:04:46 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-06-16 09:42:56 -0400
commit55e05e46684bf65124e2b0c6afb5f93448b11dad (patch)
tree28582e43b3c335250005a92eecdef4735f94c287 /src/usr/sbeio/sbe_fifodd.C
parent4ce6435b4159bd455a327e476a1fb747f77409c1 (diff)
downloadtalos-hostboot-55e05e46684bf65124e2b0c6afb5f93448b11dad.tar.gz
talos-hostboot-55e05e46684bf65124e2b0c6afb5f93448b11dad.zip
Fix bug in sbeio dd to read all FIFO after EOT
This commit adds some debug traces that were needed to debug this defect and ensures we read the entire FIFO from the SBE before trying to process the message. Change-Id: Ibcb2450a8be8bdc7f9f949744c3b27ab6ea670c9 CQ:SW355699 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25805 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio/sbe_fifodd.C')
-rw-r--r--src/usr/sbeio/sbe_fifodd.C30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/usr/sbeio/sbe_fifodd.C b/src/usr/sbeio/sbe_fifodd.C
index 637149a0f..690ce7743 100644
--- a/src/usr/sbeio/sbe_fifodd.C
+++ b/src/usr/sbeio/sbe_fifodd.C
@@ -45,6 +45,10 @@ extern trace_desc_t* g_trac_sbeio;
#define SBE_TRACD(printf_string,args...) \
TRACDCOMP(g_trac_sbeio,"fifodd: " printf_string,##args)
#define SBE_TRACU(args...)
+#define SBE_TRACFBIN(printf_string,args...) \
+ TRACFBIN(g_trac_sbeio,"fifodd: " printf_string,##args)
+#define SBE_TRACDBIN(printf_string,args...) \
+ TRACDBIN(g_trac_sbeio,"fifodd: " printf_string,##args)
/* replace for unit testing
#define SBE_TRACU(printf_string,args...) \
TRACFCOMP(g_trac_sbeio,"fifodd: " printf_string,##args)
@@ -112,6 +116,8 @@ errlHndl_t writeRequest(TARGETING::Target * i_target,
uint32_t * l_pSent = i_pFifoRequest; //advance as words sent
uint64_t l_addr = SBE_FIFO_UPFIFO_DATA_IN;
uint32_t l_cnt = *l_pSent;
+ SBE_TRACDBIN("Write Request in SBEIO",i_pFifoRequest,
+ l_cnt*sizeof(*l_pSent));
for (uint32_t i=0;i<l_cnt;i++)
{
// Wait for room to write into fifo
@@ -248,7 +254,11 @@ errlHndl_t readResponse(TARGETING::Target * i_target,
// has been sent. If not EOT, then data ready to receive.
uint32_t l_status = 0;
errl = waitDnFifoReady(i_target,l_status);
- if ( l_status & DNFIFO_STATUS_DEQUEUED_EOT_FLAG)
+ if ( (l_status & DNFIFO_STATUS_DEQUEUED_EOT_FLAG) &&
+ // @TODO-RTC:156194 - EOT should not be set until FIFO empty
+ // so once fixed, we can remove this next
+ // line
+ (!(l_status & DNFIFO_STATUS_FIFO_ENTRY_COUNT)) )
{
l_EOT = true;
// ignore EOT dummy word
@@ -274,6 +284,7 @@ errlHndl_t readResponse(TARGETING::Target * i_target,
*l_pReceived = l_last; //copy to returned output buffer
l_pReceived++; //advance to next position
l_recWords++; //count word received
+ SBE_TRACD("Read a byte from data reg: 0x%.8X",l_last);
}
while (1); // exit check in middle of loop
if (errl) break;
@@ -329,10 +340,15 @@ errlHndl_t readResponse(TARGETING::Target * i_target,
(l_last > (l_recWords)) )
{
SBE_TRACF(ERR_MRK "readResponse: invalid status distance "
- " cmd=0x%08x distance=%d response size=%d",
+ "cmd=0x%08x distance=%d allocated response size=%d "
+ "recieved word size=%d" ,
i_pFifoRequest[1],
l_last,
- i_responseSize);
+ i_responseSize,
+ l_recWords);
+
+ SBE_TRACFBIN("Invalid Response from SBE",
+ o_pFifoResponse,l_recWords*sizeof(l_last));
//TODO RTC 149454 implement error recovery and ffdc
// Consider a new callout for SBE problems.
@@ -450,11 +466,17 @@ errlHndl_t waitDnFifoReady(TARGETING::Target * i_target,
errl = readFsi(i_target,l_addr,&o_status);
if (errl) break;
- if ( !(o_status & DNFIFO_STATUS_FIFO_EMPTY) ||
+ if ( (!(o_status & DNFIFO_STATUS_FIFO_EMPTY)) ||
(o_status & DNFIFO_STATUS_DEQUEUED_EOT_FLAG) )
{
+ SBE_TRACD("Read a word from status register: 0x%.8X",o_status);
break;
}
+ else
+ {
+ SBE_TRACD("SBE status reg returned fifo empty or dequeued eot flag 0x%.8X",
+ o_status);
+ }
// time out if wait too long
if (l_elapsed_time_ns >= MAX_UP_FIFO_TIMEOUT_NS )
OpenPOWER on IntegriCloud