[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160417205938.71fcabf3@bbrezillon>
Date: Sun, 17 Apr 2016 20:59:38 +0200
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Rafał Miłecki <zajec5@...il.com>
Cc: linux-mtd@...ts.infradead.org, Richard Weinberger <richard@....at>,
David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH V2 09/11] mtd: nand: read ECC algorithm from the new
field
On Sun, 17 Apr 2016 19:11:42 +0200
Rafał Miłecki <zajec5@...il.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@...il.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
Powered by blists - more mailing lists