From: Schrempf Frieder <frieder.schrempf@kontron.de>
To: liaoweixiong <liaoweixiong@allwinnertech.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
"David Woodhouse" <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Frieder Schrempf <frieder.schrempf@exceet.de>,
Peter Pan <peterpandong@micron.com>,
"Jeff Kletsky" <git-commits@allycomm.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] mtd: spinand: read return badly if the last page has bitflips
Date: Mon, 24 Jun 2019 07:37:44 +0000 [thread overview]
Message-ID: <d406a968-a489-f457-2bde-1912618879fa@kontron.de> (raw)
In-Reply-To: <1560992416-5753-1-git-send-email-liaoweixiong@allwinnertech.com>
On 20.06.19 03:00, liaoweixiong wrote:
> In case of the last page containing bitflips (ret > 0),
> spinand_mtd_read() will return that number of bitflips for the last
> page. But to me it looks like it should instead return max_bitflips like
> it does when the last page read returns with 0.
>
> Signed-off-by: liaoweixiong <liaoweixiong@allwinnertech.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
This should probably be resent with the following tags:
Cc: stable@vger.kernel.org
Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI
NANDs")
> ---
> drivers/mtd/nand/spi/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
> index 556bfdb..6b9388d 100644
> --- 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_info *mtd, loff_t from,
> 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;
> }
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2019-06-24 7:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-20 1:00 [PATCH v2] mtd: spinand: read return badly if the last page has bitflips liaoweixiong
2019-06-20 7:13 ` Boris Brezillon
2019-06-24 7:37 ` Schrempf Frieder [this message]
2019-06-24 12:10 ` liaoweixiong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d406a968-a489-f457-2bde-1912618879fa@kontron.de \
--to=frieder.schrempf@kontron.de \
--cc=bbrezillon@kernel.org \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=frieder.schrempf@exceet.de \
--cc=git-commits@allycomm.com \
--cc=liaoweixiong@allwinnertech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=peterpandong@micron.com \
--cc=richard@nod.at \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).