mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
mtd: msm_qpic_nand: Use flash device ECC capability for erase page
Page codeword's ECC data is used to determine if the page is actually erased or not. On an erased page, this data is all 0xFF. The acceptable bitflips on this ECC data is flash device dependent. So, always check against flash device ECC capability value for erase page determination. Change-Id: Ib3889f91c871b5f131fe8bc960ffa68ac11e0633 Signed-off-by: Pradeep P V K <ppvk@codeaurora.org> Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com> Signed-off-by: Ram Kumar Dwivedi <quic_rdwivedi@quicinc.com>
This commit is contained in:
parent
43caee6871
commit
96f3098bef
1 changed files with 6 additions and 5 deletions
|
|
@ -1944,7 +1944,7 @@ free_dma:
|
|||
if (last_pos < ecc_bytes_percw_in_bits)
|
||||
num_zero_bits++;
|
||||
|
||||
if (num_zero_bits > MAX_ECC_BIT_FLIPS) {
|
||||
if (num_zero_bits > info->flash_dev.ecc_capability) {
|
||||
*erased_page = false;
|
||||
goto free_mem;
|
||||
}
|
||||
|
|
@ -1955,8 +1955,8 @@ free_dma:
|
|||
num_zero_bits = last_pos = next_pos = 0;
|
||||
ecc_temp += chip->ecc_parity_bytes;
|
||||
}
|
||||
|
||||
if ((n == cwperpage) && (num_zero_bits <= MAX_ECC_BIT_FLIPS))
|
||||
if ((n == cwperpage) &&
|
||||
(num_zero_bits <= info->flash_dev.ecc_capability))
|
||||
*erased_page = true;
|
||||
free_mem:
|
||||
kfree(ecc);
|
||||
|
|
@ -2581,7 +2581,7 @@ free_dma:
|
|||
if (last_pos < ecc_bytes_percw_in_bits)
|
||||
num_zero_bits++;
|
||||
|
||||
if (num_zero_bits > MAX_ECC_BIT_FLIPS) {
|
||||
if (num_zero_bits > info->flash_dev.ecc_capability) {
|
||||
*erased_page = false;
|
||||
goto free_mem;
|
||||
}
|
||||
|
|
@ -2593,7 +2593,8 @@ free_dma:
|
|||
ecc_temp += chip->ecc_parity_bytes;
|
||||
}
|
||||
|
||||
if ((n == cwperpage) && (num_zero_bits <= MAX_ECC_BIT_FLIPS))
|
||||
if ((n == cwperpage) &&
|
||||
(num_zero_bits <= info->flash_dev.ecc_capability))
|
||||
*erased_page = true;
|
||||
free_mem:
|
||||
kfree(ecc);
|
||||
|
|
|
|||
Loading…
Reference in a new issue