Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1530896

Re: [PATCH 19/39] mtd: nand: denali: perform erased check against raw transferred page

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 19/39] mtd: nand: denali: perform erased check against raw transferred page
Date 2016-11-27 17:20 +0100
Message-ID <sIalk-6B5-15@gated-at.bofh.it> (permalink)
References <sHPAd-1yq-5@gated-at.bofh.it> <sHPAe-1yq-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 27 Nov 2016 03:06:05 +0900
Masahiro Yamada <yamada.masahiro@socionext.com> wrote:

> The erased page check must be done against the raw transferred data.
> The current first call of is_erase() is against the data after ECC
> correction.  I saw cases where not all of the data in the page are
> 0xFF after they are manipulated by the ECC correction engine.

Hm, that's surprising. Usually ECC engines leaves data unchanged when
uncorrectable errors are detected. Do you have examples where this
happens? How did you trigger this case?

> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  drivers/mtd/nand/denali.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
> index f035dac..ae44c01 100644
> --- a/drivers/mtd/nand/denali.c
> +++ b/drivers/mtd/nand/denali.c
> @@ -1168,6 +1168,7 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
>  		INTR_STATUS__DMA_CMD_COMP | INTR_STATUS__ECC_UNCOR_ERR :
>  		INTR_STATUS__ECC_TRANSACTION_DONE | INTR_STATUS__ECC_ERR;
>  	bool check_erased_page = false;
> +	int ret;
>  
>  	if (page != denali->page) {
>  		dev_err(denali->dev,
> @@ -1206,7 +1207,9 @@ static int denali_read_page(struct mtd_info *mtd, struct nand_chip *chip,
>  		 * error.
>  		 */
>  
> -		read_oob_data(mtd, chip->oob_poi, denali->page);
> +		ret = denali_read_page_raw(mtd, chip, buf, 1, denali->page);
> +		if (ret < 0)
> +			return ret;
>  
>  		/* check ECC failures that may have occurred on erased pages */
>  		if (!is_erased(buf, mtd->writesize) ||

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 19/39] mtd: nand: denali: perform erased check against raw transferred page Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-26 19:10 +0100
  Re: [PATCH 19/39] mtd: nand: denali: perform erased check against  raw transferred page Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-27 17:20 +0100
    Re: [PATCH 19/39] mtd: nand: denali: perform erased check against raw  transferred page Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-11-30 06:40 +0100
      Re: [PATCH 19/39] mtd: nand: denali: perform erased check against  raw transferred page Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-11-30 09:10 +0100

csiph-web