Skip to content

Commit

Permalink
Fix FFDC for FW Request Errors
Browse files Browse the repository at this point in the history
Fixed wrong trace buffer string
Added FFDC to recovered logs as well

Change-Id: I40161dab8714ee399e14da00ebcb3e1cdb88c471
CQ: SW417265
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53972
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-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: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
dcrowell77 committed Mar 22, 2018
1 parent 9de67e5 commit bbe9dd4
Showing 1 changed file with 51 additions and 20 deletions.
71 changes: 51 additions & 20 deletions src/usr/util/runtime/rt_fwreq_helper.C
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,36 @@ trace_desc_t *g_trac_runtime = nullptr;
TRAC_INIT(&g_trac_runtime, RUNTIME_COMP_NAME, KILOBYTE);


/**
* @brief Add some FFDC to the error log
*
* @param i_request Pointer to request buffer
* @param i_reqLen Size of request buffer in bytes
* @param i_response Pointer to response buffer
* @param i_respLen Size of response buffer in bytes
*/
void add_ffdc( errlHndl_t i_err,
void* i_request,
size_t i_reqLen,
void* i_response,
size_t i_respLen )
{
i_err->addFFDC(RUNTIME_COMP_ID,
i_request,
i_reqLen,
0, 0, false );

if (i_respLen > 0)
{
i_err->addFFDC(RUNTIME_COMP_ID,
i_response,
i_respLen,
0, 0, false );
}

i_err->collectTrace( RUNTIME_COMP_NAME, 256);
}

/*****************************************************************************/
// firmware_request_helper
/*****************************************************************************/
Expand Down Expand Up @@ -85,8 +115,12 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
// Commit any previous errors
if (l_err)
{
// Commit any previous error log
errlCommit(l_err, RUNTIME_COMP_ID);
add_ffdc( l_err,
l_req_fw_msg, i_reqLen,
l_resp_fw_msg, *o_respLen );

// Commit any previous error log
errlCommit(l_err, RUNTIME_COMP_ID);
}

// Print trace info based on request message and populate error
Expand Down Expand Up @@ -255,8 +289,12 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
{
if (l_err)
{
// Commit any previous reset/reload error log
errlCommit(l_err, RUNTIME_COMP_ID);
add_ffdc( l_err,
l_req_fw_msg, i_reqLen,
l_resp_fw_msg, *o_respLen );

// Commit any previous reset/reload error log
errlCommit(l_err, RUNTIME_COMP_ID);
}

// This NOT a reset/reload error
Expand Down Expand Up @@ -455,8 +493,12 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
{
if (l_err)
{
// Commit any previous reset/reload error log
errlCommit(l_err, RUNTIME_COMP_ID);
add_ffdc( l_err,
l_req_fw_msg, i_reqLen,
l_resp_fw_msg, *o_respLen );

// Commit any previous reset/reload error log
errlCommit(l_err, RUNTIME_COMP_ID);
}

// This NOT a reset/reload error
Expand Down Expand Up @@ -526,20 +568,9 @@ errlHndl_t firmware_request_helper(uint64_t i_reqLen, void *i_req,
l_err->setSev(ERRL_SEV_PREDICTIVE);
}

l_err->addFFDC(RUNTIME_COMP_ID,
l_req_fw_msg,
i_reqLen,
0, 0, false );

if (*o_respLen > 0)
{
l_err->addFFDC(RUNTIME_COMP_ID,
l_resp_fw_msg,
*o_respLen,
0, 0, false );
}

l_err->collectTrace( "FW_REQ", 256);
add_ffdc( l_err,
l_req_fw_msg, i_reqLen,
l_resp_fw_msg, *o_respLen );
} // END if (l_err)

return l_err;
Expand Down

0 comments on commit bbe9dd4

Please sign in to comment.