Skip to content

Commit

Permalink
Fix bugs in FSP->HBRT message path for SBE errors
Browse files Browse the repository at this point in the history
Hostboot was expecting the incorrect order of data in messages sent
from the FSP -> PHYP -> HBRT where the SBE is requesting that HBRT
reset the SBE. This commit corrects the order and renames the struct
for the specific role its used in. Also this commit fixes the values
for the MESSAGE type sent by the FSP.

CQ: SW415675
Change-Id: I08f44486054e7d0113fd7606bb40ced577080d0c
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/53883
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <mderkse1@us.ibm.com>
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
crgeddes authored and dcrowell77 committed Feb 19, 2018
1 parent 28927a7 commit 8d28433
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
12 changes: 6 additions & 6 deletions src/include/runtime/generic_hbrt_fsp_message.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ struct TargetDeconfigHbrtFspData_t

/**
* A useful struct to access the PLID from GenericFspMboxMessage_t.data
* The PLID will be in the first 4 bytes followed by some other data.
* in the case where the FSP is requesting Hostboot to restart a SBE
*/
struct HbrtFspData_t
struct SbeRetryReqData_t
{
uint32_t huid;
uint32_t plid;
uint32_t userData;
} PACKED ;


Expand Down Expand Up @@ -139,9 +139,9 @@ struct GenericFspMboxMessage_t
MSG_TOD_TOPOLOGY_DATA = 0x0003,
MSG_DECONFIG_TARGET = 0x0004,
MSG_ATTR_SYNC_REQUEST = 0x000000A5,
MSG_SBE_ERROR = 0x000000E1,
MSG_SBE_RECOVERY_SUCCESS = 0x000000E2,
MSG_SBE_RECOVERY_FAILED = 0x000000E3,
MSG_SBE_ERROR = 0x000000D4,
MSG_SBE_RECOVERY_SUCCESS = 0x000000D5,
MSG_SBE_RECOVERY_FAILED = 0x000000D6,
};

/**
Expand Down
8 changes: 4 additions & 4 deletions src/usr/isteps/pm/runtime/test/firmwareRequestTest.H
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class FirmwareRequestTest : public CxxTest::TestSuite
uint64_t l_req_fw_msg_size(0), l_resp_fw_msg_size(0);

// Create the dynamic firmware messages
createGenericFspMsg(sizeof(HbrtFspData_t),
createGenericFspMsg(sizeof(SbeRetryReqData_t),
l_fsp_data_size,
l_req_fw_msg_size,
l_req_fw_msg,
Expand All @@ -208,11 +208,11 @@ class FirmwareRequestTest : public CxxTest::TestSuite

// Create a useful struct to populate the generic_msg::data field
// Setting the PLID and userData
HbrtFspData_t* l_fspData =
reinterpret_cast<HbrtFspData_t*>
SbeRetryReqData_t* l_fspData =
reinterpret_cast<SbeRetryReqData_t*>
(&(l_req_fw_msg->generic_msg.data));
l_fspData->huid = 0x700;
l_fspData->plid = 0x600;
l_fspData->userData = 0x700;

if (l_req_fw_msg->generic_msg.magic !=
GenericFspMboxMessage_t::MAGIC_NUMBER)
Expand Down
26 changes: 13 additions & 13 deletions src/usr/util/runtime/rt_fwnotify.C
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,34 @@ uint16_t SeqId_t::getCurrentSeqId()

/**
* @brief Attempt an SBE recovery after an SBE error
* @param[in] uint64_t i_data Contains a plid (in the first 4 bytes)
* and a HUID (in the last 4 bytes)
* @param[in] uint64_t i_data Contains a HUID (in the first 4 bytes)
* and a plid (in the last 4 bytes)
* @platform FSP, OpenPOWER
**/
void sbeAttemptRecovery(uint64_t i_data)
{
// Create a useful struct to get to the data
// The data is expected to be a plid (in the first 4 bytes)
// followed by a HUID (in the last 4 bytes).
HbrtFspData_t *l_hbrtFspData = reinterpret_cast<HbrtFspData_t*>(&i_data);
// The data is expected to be a HUID (in the first 4 bytes)
// followed by a PLID (in the last 4 bytes).
SbeRetryReqData_t *l_sbeRetryData = reinterpret_cast<SbeRetryReqData_t*>(&i_data);

TRACFCOMP(g_trac_runtime, ENTER_MRK"sbeAttemptRecovery: plid:0x%X, "
"HUID:0x%X", l_hbrtFspData->plid, l_hbrtFspData->userData);
"HUID:0x%X", l_sbeRetryData->plid, l_sbeRetryData->huid);

errlHndl_t l_err = nullptr;

do
{
// Extract the target from the given HUID
TargetHandle_t l_target =
Target::getTargetFromHuid(l_hbrtFspData->userData);
Target::getTargetFromHuid(l_sbeRetryData->huid);

// If HUID invalid, log error and quit
if (nullptr == l_target)
{
TRACFCOMP(g_trac_runtime, ERR_MRK"sbeAttemptRecovery: "
"No target associated with HUID:0x%.8X",
l_hbrtFspData->userData);
l_sbeRetryData->huid);

/*@
* @errortype
Expand All @@ -126,16 +126,16 @@ void sbeAttemptRecovery(uint64_t i_data)
l_err = new ErrlEntry( ERRL_SEV_PREDICTIVE,
MOD_RT_FIRMWARE_NOTIFY,
RC_SBE_RT_INVALID_HUID,
l_hbrtFspData->userData,
l_hbrtFspData->plid,
l_sbeRetryData->huid,
l_sbeRetryData->plid,
true);
break;
}

// Get the SBE Retry Handler, propagating the supplied PLID
SbeRetryHandler l_SBEobj = SbeRetryHandler(SbeRetryHandler::
SBE_MODE_OF_OPERATION::INFORMATIONAL_ONLY,
l_hbrtFspData->plid);
l_sbeRetryData->plid);

// Retry the recovery of the SBE
l_SBEobj.main_sbe_handler(l_target);
Expand All @@ -161,8 +161,8 @@ void sbeAttemptRecovery(uint64_t i_data)
l_err = new ErrlEntry( ERRL_SEV_PREDICTIVE,
MOD_RT_FIRMWARE_NOTIFY,
RC_FW_REQUEST_RT_NULL_PTR,
l_hbrtFspData->userData,
l_hbrtFspData->plid,
l_sbeRetryData->huid,
l_sbeRetryData->plid,
true);

break;
Expand Down

0 comments on commit 8d28433

Please sign in to comment.