diff options
author | Bilicon Patil <bilpatil@in.ibm.com> | 2013-01-08 07:36:59 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-01-10 12:20:36 -0600 |
commit | 60271e9825b3dfabff876b569b61a52d237c7f25 (patch) | |
tree | 6e24782f7a25d0bdbd6016543961bb9d645b4dd3 | |
parent | e64a4688e267b52a4bdd28da7566a20a0f7af1f0 (diff) | |
download | talos-hostboot-60271e9825b3dfabff876b569b61a52d237c7f25.tar.gz talos-hostboot-60271e9825b3dfabff876b569b61a52d237c7f25.zip |
Fixing a bug in the accessor HWP.
The l_vpdPtr was not getting incremented in
the scenario where non-matching eRepair records were found which meant
the continue statment was executed in the for loop of the
function - determineRepairLanes.
Change-Id: I74700abcd427408138904f417c6565d2aecbbbd7
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2874
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C | 42 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/erepairGetMnfgFailedLanesHwp.C | 40 |
2 files changed, 39 insertions, 43 deletions
diff --git a/src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C b/src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C index f5040ce1c..153eb17fe 100644 --- a/src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C +++ b/src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/usr/hwpf/hwp/erepairFailLaneGetHwp.C $ */ +/* $Source: src/usr/hwpf/hwp/erepairGetFailedLanesHwp.C $ */ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -245,12 +245,14 @@ fapi::ReturnCode determineRepairLanes(const fapi::Target &i_tgtHandle, std::vector<uint8_t> &o_txFailLanes, std::vector<uint8_t> &o_rxFailLanes) { - uint32_t l_numRepairs = 0; - uint8_t *l_vpdPtr = NULL; - eRepairHeader *l_vpdHeadPtr = NULL; - uint32_t l_loop = 0; - uint32_t l_bytesParsed = 0; - fapi::TargetType l_tgtType = fapi::TARGET_TYPE_NONE; + uint32_t l_numRepairs = 0; + uint8_t *l_vpdPtr = NULL; + eRepairHeader *l_vpdHeadPtr = NULL; + uint32_t l_loop = 0; + uint32_t l_bytesParsed = 0; + const uint32_t l_memRepairDataSz = sizeof(eRepairMemBus); + const uint32_t l_fabricRepairDataSz = sizeof(eRepairPowerBus); + fapi::TargetType l_tgtType = fapi::TARGET_TYPE_NONE; fapi::ReturnCode l_rc; fapi::ATTR_CHIP_UNIT_POS_Type l_busNum; @@ -277,16 +279,18 @@ fapi::ReturnCode determineRepairLanes(const fapi::Target &i_tgtHandle, eRepairPowerBus l_fabricBus; // Read Power bus eRepair data and get the failed lane numbers - for(l_loop = 0; l_loop < l_numRepairs; l_loop++) + for(l_loop = 0; + l_loop < l_numRepairs; + l_loop++, (l_vpdPtr += l_fabricRepairDataSz)) { // Make sure we are not parsing more data than the passed size - l_bytesParsed += sizeof(eRepairPowerBus); + l_bytesParsed += l_fabricRepairDataSz; if(l_bytesParsed > i_bufSz) { break; } - memcpy(&l_fabricBus, l_vpdPtr, sizeof(eRepairPowerBus)); + memcpy(&l_fabricBus, l_vpdPtr, l_fabricRepairDataSz); // Check if we have the correct Processor ID // Get the MRU ID of the passed processor target and @@ -329,10 +333,6 @@ fapi::ReturnCode determineRepairLanes(const fapi::Target &i_tgtHandle, { o_rxFailLanes.push_back(l_fabricBus.failBit); } - - // Increment pointer to point to the next fabric repair data - l_vpdPtr += sizeof(eRepairPowerBus); - } // end of for loop } // end of if(l_tgtType is XBus or ABus) else if(l_tgtType == fapi::TARGET_TYPE_MCS_CHIPLET) @@ -341,16 +341,18 @@ fapi::ReturnCode determineRepairLanes(const fapi::Target &i_tgtHandle, eRepairMemBus l_memBus; // Read Power bus eRepair data and get the failed lane numbers - for(l_loop = 0; l_loop < l_numRepairs; l_loop++) + for(l_loop = 0; + l_loop < l_numRepairs; + l_loop++, (l_vpdPtr += l_memRepairDataSz)) { // Make sure we are not parsing more data than the passed size - l_bytesParsed += sizeof(eRepairMemBus); + l_bytesParsed += l_memRepairDataSz; if(l_bytesParsed > i_bufSz) { break; } - memcpy(&l_memBus, l_vpdPtr, sizeof(eRepairMemBus)); + memcpy(&l_memBus, l_vpdPtr, l_memRepairDataSz); // Check if we have the correct Processor ID // Get the MRU ID of the passed processor target and @@ -392,10 +394,6 @@ fapi::ReturnCode determineRepairLanes(const fapi::Target &i_tgtHandle, { o_rxFailLanes.push_back(l_memBus.failBit); } - - // Increment pointer to point to the next dmi repair data - l_vpdPtr += sizeof(eRepairMemBus); - } // end of for loop } // end of if(l_tgtType is MCS) diff --git a/src/usr/hwpf/hwp/erepairGetMnfgFailedLanesHwp.C b/src/usr/hwpf/hwp/erepairGetMnfgFailedLanesHwp.C index f568d18b0..1c9ab547a 100644 --- a/src/usr/hwpf/hwp/erepairGetMnfgFailedLanesHwp.C +++ b/src/usr/hwpf/hwp/erepairGetMnfgFailedLanesHwp.C @@ -5,7 +5,7 @@ /* */ /* IBM CONFIDENTIAL */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012 */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ /* */ /* p1 */ /* */ @@ -251,12 +251,14 @@ fapi::ReturnCode determineMnfgRepairLanes(const fapi::Target &i_tgtHandle, std::vector<uint8_t> &o_txFailLanes, std::vector<uint8_t> &o_rxFailLanes) { - uint32_t l_numRepairs = 0; - uint8_t *l_vpdPtr = NULL; - eRepairHeader *l_vpdHeadPtr = NULL; - uint32_t l_loop = 0; - uint32_t l_bytesParsed = 0; - fapi::TargetType l_tgtType = fapi::TARGET_TYPE_NONE; + uint32_t l_numRepairs = 0; + uint8_t *l_vpdPtr = NULL; + eRepairHeader *l_vpdHeadPtr = NULL; + uint32_t l_loop = 0; + uint32_t l_bytesParsed = 0; + const uint32_t l_memRepairDataSz = sizeof(eRepairMemBus); + const uint32_t l_fabricRepairDataSz = sizeof(eRepairPowerBus); + fapi::TargetType l_tgtType = fapi::TARGET_TYPE_NONE; fapi::ReturnCode l_rc; fapi::ATTR_CHIP_UNIT_POS_Type l_busNum; @@ -283,16 +285,18 @@ fapi::ReturnCode determineMnfgRepairLanes(const fapi::Target &i_tgtHandle, eRepairPowerBus l_fabricBus; // Read Power bus eRepair data and get the failed lane numbers - for(l_loop = 0; l_loop < l_numRepairs; l_loop++) + for(l_loop = 0; + l_loop < l_numRepairs; + l_loop++, (l_vpdPtr += l_fabricRepairDataSz)) { // Make sure we are not parsing more data than the passed size - l_bytesParsed += sizeof(eRepairPowerBus); + l_bytesParsed += l_fabricRepairDataSz; if(l_bytesParsed > i_bufSz) { break; } - memcpy(&l_fabricBus, l_vpdPtr, sizeof(eRepairPowerBus)); + memcpy(&l_fabricBus, l_vpdPtr, l_fabricRepairDataSz); // Check if we have the correct Processor ID // Get the MRU ID of the passed processor target and @@ -335,10 +339,6 @@ fapi::ReturnCode determineMnfgRepairLanes(const fapi::Target &i_tgtHandle, { o_rxFailLanes.push_back(l_fabricBus.failBit); } - - // Increment pointer to point to the next fabric repair data - l_vpdPtr += sizeof(eRepairPowerBus); - } // end of for loop } // end of if(l_tgtType is XBus or ABus) else if(l_tgtType == fapi::TARGET_TYPE_MCS_CHIPLET) @@ -347,16 +347,18 @@ fapi::ReturnCode determineMnfgRepairLanes(const fapi::Target &i_tgtHandle, eRepairMemBus l_memBus; // Read Power bus eRepair data and get the failed lane numbers - for(l_loop = 0; l_loop < l_numRepairs; l_loop++) + for(l_loop = 0; + l_loop < l_numRepairs; + l_loop++, (l_vpdPtr += l_memRepairDataSz)) { // Make sure we are not parsing more data than the passed size - l_bytesParsed += sizeof(eRepairMemBus); + l_bytesParsed += l_memRepairDataSz; if(l_bytesParsed > i_bufSz) { break; } - memcpy(&l_memBus, l_vpdPtr, sizeof(eRepairMemBus)); + memcpy(&l_memBus, l_vpdPtr, l_memRepairDataSz); // Check if we have the correct Processor ID // Get the MRU ID of the passed processor target and @@ -398,10 +400,6 @@ fapi::ReturnCode determineMnfgRepairLanes(const fapi::Target &i_tgtHandle, { o_rxFailLanes.push_back(l_memBus.failBit); } - - // Increment pointer to point to the next dmi repair data - l_vpdPtr += sizeof(eRepairMemBus); - } // end of for loop } // end of if(l_tgtType is MCS) |