Skip to content

Commit

Permalink
eRepair: Fix to update invalidate lane record correctly
Browse files Browse the repository at this point in the history
Change-Id: I77f5de27945a6cd4150203c55f7dc1935eee7eaf
CQ: SW445331
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66126
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/66131
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: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
sumitk56 authored and crgeddes committed Sep 18, 2018
1 parent 09b976d commit b5704a1
Showing 1 changed file with 51 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ fapi2::ReturnCode updateRepairLanesToBufProc(
{
uint32_t temp = (uint32_t)(l_overWritePtr->failBit);
uint32_t* tptr = &temp;
FAPI_INF("Status(after):Status(before):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
FAPI_INF("Status(before):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
FAPI_TRY( gatherRepairLanes(
i_target,
l_overWritePtr->interface,
Expand Down Expand Up @@ -831,19 +831,27 @@ fapi2::ReturnCode updateRepairLanesToBufMemBuf(
FAPI_INF("repairLaneCnt-3:Found match: Dev id:%d type:%d IF:%d Bus:%d ", l_overWritePtr->device.proc_centaur_id,
l_overWritePtr->type, l_overWritePtr->interface, l_overWritePtr->device.memChannel);

// update the failBit number
uint32_t temp = (uint32_t)(l_overWritePtr->failBit);
uint32_t* tptr = &temp;
FAPI_INF("Status(before):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
FAPI_TRY( gatherRepairLanes(
i_target,
l_overWritePtr->interface,
l_repairLane,
tptr),
"gatherRepairLanes() failed w/rc=0x%x",
static_cast<uint64_t>(fapi2::current_err) );
l_overWritePtr->failBit = temp;
FAPI_INF("Status(after):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
if(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER)
{
FAPI_INF("FailBit:0x%x is invalidated(reset to zero)", l_overWritePtr->failBit);
l_overWritePtr->failBit = 0;
l_newNumRepairs--;
}
else // update the failBit number
{
uint32_t temp = (uint32_t)(l_overWritePtr->failBit);
uint32_t* tptr = &temp;
FAPI_INF("Status(before):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
FAPI_TRY( gatherRepairLanes(
i_target,
l_overWritePtr->interface,
l_repairLane,
tptr),
"gatherRepairLanes() failed w/rc=0x%x",
static_cast<uint64_t>(fapi2::current_err) );
l_overWritePtr->failBit = temp;
FAPI_INF("Status(after):FailBit:0x%x temp:0x%x ", l_overWritePtr->failBit, temp);
}

// Matching record found
l_overWrite = true;
Expand All @@ -864,7 +872,8 @@ fapi2::ReturnCode updateRepairLanesToBufMemBuf(

} // end of for(vpd Parsing)

if(l_overWrite == true)
if( (l_overWrite == true) ||
(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER) )
{
// Go for the next repairLane
continue;
Expand Down Expand Up @@ -1045,20 +1054,29 @@ fapi2::ReturnCode updateRepairLanesToBufMemBuf(
l_overWritePtr =
reinterpret_cast<eRepairMemBus_cdimm*> (l_vpdDataPtr);

FAPI_DBG("repairLaneCnt-2:erepairCnt:%d numRepair:%d byteparsed:%d bufSize:%d ", l_repairCnt, l_numRepairs,
FAPI_INF("repairLaneCnt-2:erepairCnt:%d numRepair:%d byteparsed:%d bufSize:%d ", l_repairCnt, l_numRepairs,
l_bytesParsed,
i_bufSz);

if( (l_overWritePtr->device.proc_centaur_id == l_chipNum) &&
(l_overWritePtr->device.memChannel == l_busNum ) &&
(l_overWritePtr->type == EREPAIR::MEMORY_EDIP) &&
(l_overWritePtr->failBit == l_repairLane) &&
((l_overWritePtr->failBit == l_repairLane) ||
(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER)) &&
(((i_interface == EREPAIR::DRIVE) && (l_overWritePtr->interface == EREPAIR::DMI_MEMBUF_DRIVE)) ||
((i_interface == EREPAIR::RECEIVE) && (l_overWritePtr->interface == EREPAIR::DMI_MEMBUF_RECEIVE))) )
{
FAPI_INF("repairLaneCnt-3:Found match: Dev id:%d type:%d IF:%d Bus:%d FailBit:%d ",
l_overWritePtr->device.proc_centaur_id,
l_overWritePtr->type, l_overWritePtr->interface, l_overWritePtr->device.memChannel, l_overWritePtr->failBit);
FAPI_INF("repairLaneCnt-3:Found match: Dev id:%d type:%d IF:%d Bus:%d FailBit:%d erprlane:%02x",
l_overWritePtr->device.proc_centaur_id, l_overWritePtr->type, l_overWritePtr->interface,
l_overWritePtr->device.memChannel, l_overWritePtr->failBit, l_repairLane);

if(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER)
{
FAPI_INF("repairLaneCnt-4:Invalidated lane number:0x%2x",
l_overWritePtr->failBit);
l_overWritePtr->failBit = l_repairLane;
l_newNumRepairs--;
}

// Matching record exist so no action taken; goto next record
// Note: To be consistent & avoid too may variables to track
Expand All @@ -1073,7 +1091,8 @@ fapi2::ReturnCode updateRepairLanesToBufMemBuf(

} // end of for(vpd Parsing)

if(l_overWrite == true)
if( (l_overWrite == true) ||
(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER) )
{
// Go for the next repairLane
continue;
Expand Down Expand Up @@ -1296,7 +1315,7 @@ fapi2::ReturnCode updateRepairLanesToBufDMI(
l_overWritePtr =
reinterpret_cast<eRepairMemBus*> (l_vpdDataPtr);

FAPI_DBG("repairLaneCnt-2:repariCnt:%d numRepair:%d byteparsed:%d bufSize:%d ", l_repairCnt, l_numRepairs,
FAPI_INF("repairLaneCnt-2:repariCnt:%d numRepair:%d byteparsed:%d bufSize:%d ", l_repairCnt, l_numRepairs,
l_bytesParsed,
i_bufSz);

Expand All @@ -1310,7 +1329,14 @@ fapi2::ReturnCode updateRepairLanesToBufDMI(
FAPI_INF("repairLaneCnt-3:Found match: Dev id:%d type:%d IF:%d Bus:%d ", l_overWritePtr->device.proc_centaur_id,
l_overWritePtr->type, l_overWritePtr->interface, l_overWritePtr->device.memChannel);

// update the failBit number
if(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER)
{
FAPI_INF("FailBit:0x%x is invalidated(reset to zero)",
l_overWritePtr->failBit);
l_overWritePtr->failBit = 0;
l_newNumRepairs--;
}
else // update the failBit number
{
uint32_t temp = (uint32_t)(l_overWritePtr->failBit);
uint32_t* tptr = &temp;
Expand Down Expand Up @@ -1345,7 +1371,8 @@ fapi2::ReturnCode updateRepairLanesToBufDMI(

} // end of for(vpd Parsing)

if(l_overWrite == true)
if( (l_overWrite == true) ||
(l_repairLane == EREPAIR::INVALID_FAIL_LANE_NUMBER) )
{
// Go for the next repairLane
continue;
Expand Down

0 comments on commit b5704a1

Please sign in to comment.