linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Bean Huo <beanhuo@micron.com>,
	Peter Pan <peterpandong@micron.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] mtd: rawnand: Do not check FAIL bit when executing a SET_FEATURES op
Date: Mon, 14 May 2018 10:54:51 +0200	[thread overview]
Message-ID: <20180514105451.43537aef@xps13> (raw)
In-Reply-To: <20180511124407.7314-1-boris.brezillon@bootlin.com>

Hi Boris,

On Fri, 11 May 2018 14:44:07 +0200, Boris Brezillon
<boris.brezillon@bootlin.com> wrote:

> The ONFI spec clearly says that FAIL bit is only valid for PROGRAM,
> ERASE and READ-with-on-die-ECC operations, and should be ignored
> otherwise.
> 
> It seems that checking it after sending a SET_FEATURES is a bad idea
> because a previous READ, PROGRAM or ERASE op may have failed, and
> depending on the implementation, the FAIL bit is not cleared until a
> new READ, PROGRAM or ERASE is started.
> 
> This leads to ->set_features() returning -EIO while it actually worked,
> which can sometimes stop a batch of READ/PROGRAM ops.
> 
> Note that we only fix the ->exec_op() path here, because some drivers
> are abusing the NAND_STATUS_FAIL flag in their ->waitfunc()
> implementation to propagate other kind of errors, like
> wait-ready-timeout or controller-related errors. Let's not try to fix
> those drivers since they worked fine so far.
> 
> Fixes: 8878b126df76 ("mtd: nand: add ->exec_op() implementation")
> Cc: stable@vger.kernel.org
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---

So we have no real way to know if a SET_FEATURES actually succeeded.
I checked the ONFI spec and could not find anything. A GET_FEATURES
will do the trick though (when supported).

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

  reply	other threads:[~2018-05-14  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 12:44 [PATCH v2] mtd: rawnand: Do not check FAIL bit when executing a SET_FEATURES op Boris Brezillon
2018-05-14  8:54 ` Miquel Raynal [this message]
2018-05-18  6:55 ` Boris Brezillon

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=20180514105451.43537aef@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=beanhuo@micron.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=peterpandong@micron.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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).