Skip to content

Commit

Permalink
Increase SBE timeout to 90 seconds
Browse files Browse the repository at this point in the history
There is at least 1 scenario where the FSP and HB are both
accessing the SBE at the same time.  The FSP operation can
take a very long time so HB is increasing our timeout so
that we don't fail if we happen to hit that window.

Change-Id: I8908608a1db4ac8c27ded59eced8f0ad71f70314
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/35612
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
dcrowell77 authored and wghoffa committed Feb 1, 2017
1 parent 68c831b commit dd31bfd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/include/usr/sbeio/sbe_psudd.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -384,9 +384,10 @@ class SbePsu

/**
* @brief timeout values
*
* Making this value big enough to handle being queued up
* behind a slow FSP operation (e.g. getmempba)
*/
static const uint64_t MAX_PSU_SHORT_TIMEOUT_NS=100*NS_PER_MSEC; //=100ms
static const uint64_t MAX_PSU_SHORT_TIMEOUT_NS=90*NS_PER_SEC; //=90sec

/**
* @brief enums for primary SBE response
Expand Down
19 changes: 8 additions & 11 deletions src/usr/sbeio/sbe_psudd.C
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -221,9 +221,8 @@ errlHndl_t SbePsu::writeRequest(TARGETING::Target * i_target,
// Read SBE doorbell to confirm ready to accept command.
// Since the device driver single threads the requests, we should
// never see not being ready to send a request.
uint64_t l_addr = PSU_SBE_DOORBELL_REG_RW;
uint64_t l_data = 0;
errl = readScom(i_target,l_addr,&l_data);
errl = readScom(i_target,PSU_SBE_DOORBELL_REG_RW,&l_data);
if (errl) break;
if (l_data & SBE_DOORBELL)
{
Expand Down Expand Up @@ -280,7 +279,7 @@ errlHndl_t SbePsu::writeRequest(TARGETING::Target * i_target,

//write the command registers
uint64_t * l_pMessage = (uint64_t *)i_pPsuRequest;
l_addr = PSU_HOST_SBE_MBOX0_REG;
uint64_t l_addr = PSU_HOST_SBE_MBOX0_REG;
for (uint8_t i=0;i<4;i++)
{
if (0x01 & i_reqMsgs) // write register if non-reserved
Expand All @@ -295,9 +294,8 @@ errlHndl_t SbePsu::writeRequest(TARGETING::Target * i_target,
if (errl) break;

//notify PSU command is ready
l_addr = PSU_SBE_DOORBELL_REG_OR;
l_data = SBE_DOORBELL;
errl = writeScom(i_target,l_addr,&l_data);
errl = writeScom(i_target,PSU_SBE_DOORBELL_REG_OR,&l_data);
if (errl) break;

}
Expand Down Expand Up @@ -344,9 +342,8 @@ errlHndl_t SbePsu::readResponse(TARGETING::Target * i_target,
if (errl) break;

//notify PSU response has been read
l_addr = PSU_HOST_DOORBELL_REG_AND;
uint64_t l_data = HOST_CLEAR_RESPONSE_WAITING;
errl = writeScom(i_target,l_addr,&l_data);
errl = writeScom(i_target,PSU_HOST_DOORBELL_REG_AND,&l_data);
if (errl) break;

//check status and seq ID in response messages
Expand Down Expand Up @@ -431,14 +428,13 @@ errlHndl_t SbePsu::pollForPsuComplete(TARGETING::Target * i_target,
SBE_TRACD(ENTER_MRK "pollForPsuComplete");

uint64_t l_elapsed_time_ns = 0;
uint64_t l_addr = PSU_HOST_DOORBELL_REG_RW;
uint64_t l_data = 0;
bool l_trace = true; //initialize so first call is traced

do
{
// read response doorbell to see if ready
errl = readScom(i_target,l_addr,&l_data,l_trace);
errl = readScom(i_target,PSU_HOST_DOORBELL_REG_RW,&l_data,l_trace);
if (errl) break; // return with error

// check if response is now ready to be read
Expand All @@ -451,7 +447,8 @@ errlHndl_t SbePsu::pollForPsuComplete(TARGETING::Target * i_target,
if (l_elapsed_time_ns > i_timeout )
{
SBE_TRACF(ERR_MRK "pollForPsuComplete: "
"timeout waiting for PSU request to complete");
"timeout waiting for PSU request to complete"
": doorbell=%.8X", l_data);

/*@
* @errortype
Expand Down

0 comments on commit dd31bfd

Please sign in to comment.