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


Groups > linux.kernel > #1380818

Re: [PATCH V2 09/11] mtd: nand: read ECC algorithm from the new field

From Boris Brezillon <boris.brezillon@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH V2 09/11] mtd: nand: read ECC algorithm from the new field
Date 2016-04-17 21:10 +0200
Message-ID <rp0f0-OC-15@gated-at.bofh.it> (permalink)
References <roi4i-8kL-5@gated-at.bofh.it> <roYwy-7T4-7@gated-at.bofh.it> <roYwz-7T4-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, 17 Apr 2016 19:11:42 +0200
Rafał Miłecki <zajec5@gmail.com> wrote:

> Now we have all drivers properly setting this new field we can start
> using it. For a very short period of time we should support both values:
> NAND_ECC_SOFT and NAND_ECC_SOFT_BCH treating them the same. It's because
> of_get_nand_ecc_mode may still be setting NAND_ECC_SOFT_BCH.
> 
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> V2: Move SOFT-related code to separated functions
>     Add missing checks for SOFT before checking Hamming vs. BCH
> ---
>  drivers/mtd/nand/nand_base.c | 116 ++++++++++++++++++++++++++-----------------
>  1 file changed, 71 insertions(+), 45 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c

[...]

>  
> @@ -4154,7 +4217,9 @@ int nand_scan_tail(struct mtd_info *mtd)
>  	/*
>  	 * If no default placement scheme is given, select an appropriate one.
>  	 */
> -	if (!mtd->ooblayout && (ecc->mode != NAND_ECC_SOFT_BCH)) {
> +	if (!mtd->ooblayout &&
> +	    (ecc->mode == NAND_ECC_SOFT || ecc->mode == NAND_ECC_SOFT_BCH) &&
> +	    ecc->algo != NAND_ECC_BCH) {

Sorry, I got this wrong in my previous review. It should be

	if (!mtd->ooblayout &&
	    ((ecc->mode != NAND_ECC_SOFT &&
	      ecc->mode != NAND_ECC_SOFT_BCH) ||
	     ecc->algo != NAND_ECC_BCH) {

otherwise we're only addressing the software ECC case, and IIRC, some
drivers rely on these default layouts for their HW ECC implementation.

The rest looks good to me.

Thanks,

Boris


-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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


Thread

[PATCH V2 09/11] mtd: nand: read ECC algorithm from the new field Rafał Miłecki <zajec5@gmail.com> - 2016-04-17 19:20 +0200
  Re: [PATCH V2 09/11] mtd: nand: read ECC algorithm from the new  field Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-04-17 21:10 +0200

csiph-web