]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: rawnand: qcom: erased page detection for uncorrectable errors only
authorAbhishek Sahu <absahu@codeaurora.org>
Wed, 20 Jun 2018 07:27:34 +0000 (12:57 +0530)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 18 Jul 2018 07:24:07 +0000 (09:24 +0200)
commit64a0a49e908fd624b862850a486b5d7c9162ef1e
tree82a15e78346f59cc84a4d5413776e3ad34603506
parent29ebab760736f3184c5c13ce3d47b8f97c2fa6e7
mtd: rawnand: qcom: erased page detection for uncorrectable errors only

Following is the flow in the HW if controller tries to read erased
page:

1. First ECC uncorrectable error will be generated from ECC engine
   since ECC engine first calculates the ECC with all 0xff and match
   the calculated ECC with ECC code in OOB (which is again all 0xff).
2. After getting ECC error, erased CW detection logic will be
   applied which is different for BCH and RS ECC
    a. For BCH, HW checks if all the bytes in page are 0xff and then
       it updates the status in separate register
       NAND_ERASED_CW_DETECT_STATUS.
    b. For RS ECC, the HW reports the same error when reading an
       erased CW, but it notifies that it is an erased CW by
       placing special characters at certain offsets in the
       buffer.

So the erased CW detect status should be checked only if ECC engine
generated the uncorrectable error.

Currently for all other operational errors also (like TIMEOUT, MPU
errors, etc.), the erased CW detect logic is being applied so fix this
and return EIO for other operational errors.

Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/qcom_nandc.c