[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200928150019.9404-1-miquel.raynal@bootlin.com>
Date: Mon, 28 Sep 2020 17:00:19 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Tudor Ambarus <tudor.ambarus@...rochip.com>,
miquel.raynal@...tlin.com, richard@....at, vigneshr@...com,
boris.brezillon@...labora.com
Cc: linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
Santiago Esteban <santiago.esteban@...rochip.com>
Subject: Re: [PATCH 1/3] mtd: rawnand: Fix wrongful fallthrough NAND_ECC_SOFT
On Thu, 2020-09-17 at 07:52:11 UTC, Tudor Ambarus wrote:
> In case of valid HW ECC, where the fallback to SW ECC is not needed,
> the mentioned commit breaks the "switch (ecc->placement)" statement,
> but then wrongly falls through the "case NAND_ECC_SOFT" of the
> parent "switch (ecc->mode)". This causes an -EINVAL in
> nand_set_ecc_soft_ops(), because for the valid HW ECC cases
> ecc->mode is set to NAND_ECC_HW, but the nand_set_ecc_soft_ops()
> expects a NAND_ECC_SOFT mode, thus -EINVAL.
>
> Move the fallback to SW ECC after the setting of the ECC on host ops.
> With this, when a valid HW ECC is available, we break the
> "switch (ecc->mode)" statement, and when a fallback to SW ECC is
> needed, we fallthrough "case NAND_ECC_SOFT".
>
> Fixes: d3f8ec8e979b ("mtd: rawnand: Separate the ECC engine type and the ECC byte placement")
> Reported-by: Santiago Esteban <santiago.esteban@...rochip.com>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@...rochip.com>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.
Miquel
Powered by blists - more mailing lists