Matt Ploetz | 72ce462 | 2015-04-30 08:36:21 -0500 | [diff] [blame] | 1 | From 69e22b2f8c8425b4f2ec8f7adcf164afed7f2ff8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Dan Crowell <dcrowell@us.ibm.com> |
| 3 | Date: Mon, 27 Apr 2015 13:48:57 -0500 |
| 4 | Subject: [PATCH] Fix handling of ECC protected partitions at runtime |
| 5 | |
| 6 | Modify the code to only check ECC on the logical size of the data |
| 7 | that is read, rather than on the full physical size. |
| 8 | |
| 9 | Change-Id: Ia45989e64ef70e63542274ef59df2cc755f8082e |
| 10 | --- |
| 11 | src/usr/pnor/runtime/rt_pnor.C | 4 +++- |
| 12 | 1 file changed, 3 insertions(+), 1 deletion(-) |
| 13 | |
| 14 | diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C |
| 15 | index d434f26..6e52999 100644 |
| 16 | --- a/src/usr/pnor/runtime/rt_pnor.C |
| 17 | +++ b/src/usr/pnor/runtime/rt_pnor.C |
| 18 | @@ -405,10 +405,12 @@ errlHndl_t RtPnor::readFromDevice (uint64_t i_procId, |
| 19 | { |
| 20 | TRACFCOMP(g_trac_pnor, "RtPnor::readFromDevice: removing ECC..."); |
| 21 | // remove the ECC and fix the original data if it is broken |
| 22 | + size_t l_eccSize = (l_rc/9)*8; |
| 23 | + l_eccSize = std::min( l_eccSize, i_size ); |
| 24 | PNOR::ECC::eccStatus ecc_stat = |
| 25 | PNOR::ECC::removeECC(reinterpret_cast<uint8_t*>(l_dataToRead), |
| 26 | reinterpret_cast<uint8_t*>(o_data), |
| 27 | - l_rc); //actual size of read data |
| 28 | + l_eccSize); //logical size of read data |
| 29 | |
| 30 | // create an error if we couldn't correct things |
| 31 | if( ecc_stat == PNOR::ECC::UNCORRECTABLE ) |
| 32 | -- |
| 33 | 1.8.2.2 |
| 34 | |