Skip to content

Commit 87e02ae

Browse files
Aryan Srivastavagregkh
authored andcommitted
mtd: nand: relax ECC parameter validation check
[ Upstream commit 050553c ] Due to the custom handling and layouts of certain nand controllers this validity check will always fail for certain layouts. The check inherently depends on even chunk sizing and this is not always the case. Modify the check to only print a warning, instead of failing to init the attached NAND. This allows various 8 bit and 12 ECC strength layouts to be used. Fixes: 68c18da ("mtd: rawnand: marvell: add missing layouts") Signed-off-by: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent bfbb870 commit 87e02ae

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/mtd/nand/raw/nand_base.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6469,11 +6469,14 @@ static int nand_scan_tail(struct nand_chip *chip)
64696469
ecc->steps = mtd->writesize / ecc->size;
64706470
if (!base->ecc.ctx.nsteps)
64716471
base->ecc.ctx.nsteps = ecc->steps;
6472-
if (ecc->steps * ecc->size != mtd->writesize) {
6473-
WARN(1, "Invalid ECC parameters\n");
6474-
ret = -EINVAL;
6475-
goto err_nand_manuf_cleanup;
6476-
}
6472+
6473+
/*
6474+
* Validity check: Warn if ECC parameters are not compatible with page size.
6475+
* Due to the custom handling of ECC blocks in certain controllers the check
6476+
* may result in an expected failure.
6477+
*/
6478+
if (ecc->steps * ecc->size != mtd->writesize)
6479+
pr_warn("ECC parameters may be invalid in reference to underlying NAND chip\n");
64776480

64786481
if (!ecc->total) {
64796482
ecc->total = ecc->steps * ecc->bytes;

0 commit comments

Comments
 (0)