diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-03-30 15:45:52 +0900 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-04-25 14:18:34 +0200 |
commit | 24715c749b2ff5545f0316e7ad8b65026f9e9612 (patch) | |
tree | 911df863e0e9eed6782d75c56032758379390fa9 /kernel/ptrace.c | |
parent | d29109be2e8d4a102d8304d7b8bb0d6dfe5e1d27 (diff) | |
download | op-kernel-dev-24715c749b2ff5545f0316e7ad8b65026f9e9612.zip op-kernel-dev-24715c749b2ff5545f0316e7ad8b65026f9e9612.tar.gz |
mtd: nand: denali: support HW_ECC_FIXUP capability
Some old versions of the Denali IP (perhaps used only for Intel?)
detects ECC errors and provides correct data via a register, but
does not touch the transferred data. So, the software must fixup
the data in the buffer according to the provided ECC correction
information.
Newer versions perform ECC correction before transferring the data.
No more software intervention is needed. The ECC_ERROR_ADDRESS and
ECC_CORRECTION_INFO registers were deprecated. Instead, the number
of corrected bit-flips are reported via the ECC_COR_INFO register.
When an uncorrectable ECC error happens, a status flag is set to the
INTR_STATUS and ECC_COR_INFO registers.
As is often the case with this IP, the register view of INTR_STATUS
had broken compatibility.
For older versions (SW ECC fixup):
bit 0: ECC_TRANSACTION_DONE
bit 1: ECC_ERR
For newer versions (HW ECC fixup):
bit 0: ECC_UNCOR_ERR
bit 1: Reserved
Due to this difference, the irq_mask must be fixed too.
The existing handle_ecc() has been renamed to denali_sw_ecc_fixup()
for clarification.
What is unfortunate with this feature is we can not know the total
number of corrected/uncorrected errors in a page. The register
ECC_COR_INFO reports the maximum of per-sector bitflips. This is
useful for ->read_page return value, but ecc_stats.{corrected,failed}
increments may not be precise.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions