Re: [PATCH v2 12/53] mtd: nand: denali: support HW_ECC_FIXUP capability

From: Masahiro Yamada
Date: Thu Mar 23 2017 - 03:34:33 EST


Hi Boris,


2017-03-23 6:12 GMT+09:00 Boris Brezillon <boris.brezillon@xxxxxxxxxxxxxxxxxx>:
> On Wed, 22 Mar 2017 23:07:19 +0900
> Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx> wrote:
>
>> +static int denali_hw_ecc_fixup(struct mtd_info *mtd,
>> + struct denali_nand_info *denali)
>> +{
>> + int bank = denali->flash_bank;
>> + uint32_t ecc_cor;
>> + unsigned int max_bitflips;
>> +
>> + ecc_cor = ioread32(denali->flash_reg + ECC_COR_INFO(bank));
>> + ecc_cor >>= ECC_COR_INFO__SHIFT(bank);
>> +
>> + if (ecc_cor & ECC_COR_INFO__UNCOR_ERR)
>> + return -EBADMSG;
>
> As previously mentioned, just increment ecc_stats.failed.
>

I explained the intention of -EBADMSG in 11/53.

ecc_stats.failed is incremented in denali_read_page().


--
Best Regards
Masahiro Yamada