stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Abhishek Sahu <absahu@codeaurora.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org, linux-mtd@lists.infradead.org,
	Richard Weinberger <richard@nod.at>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: rawnand: fix return value check for bad block status
Date: Fri, 22 Jun 2018 13:34:36 +0200	[thread overview]
Message-ID: <20180622133436.39e1466d@bbrezillon> (raw)
In-Reply-To: <20180618155757.6cbe0fae@xps13>

On Mon, 18 Jun 2018 15:57:57 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:

> Hi Boris,
> 
> On Wed, 13 Jun 2018 14:32:36 +0530, Abhishek Sahu
> <absahu@codeaurora.org> wrote:
> 
> > Positive return value from read_oob() is making false BAD
> > blocks. For some of the NAND controllers, OOB bytes will be
> > protected with ECC and read_oob() will return number of bitflips.
> > If there is any bitflip in ECC protected OOB bytes for BAD block
> > status page, then that block is getting treated as BAD.
> > 
> > Fixes: c120e75e0e7d ("mtd: nand: use read_oob() instead of cmdfunc() for bad block check")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> > ---
> >  drivers/mtd/nand/raw/nand_base.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
> > index f28c3a5..4a73f73 100644
> > --- a/drivers/mtd/nand/raw/nand_base.c
> > +++ b/drivers/mtd/nand/raw/nand_base.c
> > @@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs)
> >  
> >  	for (; page < page_end; page++) {
> >  		res = chip->ecc.read_oob(mtd, chip, page);
> > -		if (res)
> > +		if (res < 0)
> >  			return res;
> >  
> >  		bad = chip->oob_poi[chip->badblockpos];  
> 
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Applied.

Thanks,

Boris

> 
> I suppose this patch is a good candidate to be part of a future
> mtd/fixes PR?
> 
> Regards,
> Miquèl
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

      reply	other threads:[~2018-06-22 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13  9:02 [PATCH] mtd: rawnand: fix return value check for bad block status Abhishek Sahu
2018-06-18 13:57 ` Miquel Raynal
2018-06-22 11:34   ` Boris Brezillon [this message]

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=20180622133436.39e1466d@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=absahu@codeaurora.org \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    /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).