[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190724191803.377727180@linuxfoundation.org>
Date: Wed, 24 Jul 2019 21:21:29 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Weixiong Liao <liaoweixiong@...winnertech.com>,
Boris Brezillon <boris.brezillon@...labora.com>,
Frieder Schrempf <frieder.schrempf@...tron.de>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: [PATCH 5.2 398/413] mtd: spinand: read returns badly if the last page has bitflips
From: liaoweixiong <liaoweixiong@...winnertech.com>
commit b83408b580eccf8d2797cd6cb9ae42c2a28656a7 upstream.
In case of the last page containing bitflips (ret > 0),
spinand_mtd_read() will return that number of bitflips for the last
page while it should instead return max_bitflips like it does when the
last page read returns with 0.
Signed-off-by: Weixiong Liao <liaoweixiong@...winnertech.com>
Reviewed-by: Boris Brezillon <boris.brezillon@...labora.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@...tron.de>
Cc: stable@...r.kernel.org
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs")
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/mtd/nand/spi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -511,12 +511,12 @@ static int spinand_mtd_read(struct mtd_i
if (ret == -EBADMSG) {
ecc_failed = true;
mtd->ecc_stats.failed++;
- ret = 0;
} else {
mtd->ecc_stats.corrected += ret;
max_bitflips = max_t(unsigned int, max_bitflips, ret);
}
+ ret = 0;
ops->retlen += iter.req.datalen;
ops->oobretlen += iter.req.ooblen;
}
Powered by blists - more mailing lists