linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Emil Lenngren <emil.lenngren@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Emil Lenngren <emil.lenngren@gmail.com>,
	Boris Brezillon <boris.brezillon@bootlin.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>
Subject: [PATCH] mtd: spinand: Wait after erase in spinand_markbad
Date: Fri, 21 Dec 2018 12:58:14 +0100	[thread overview]
Message-ID: <20181221115831.9595-1-emil.lenngren@gmail.com> (raw)

SPI NAND flashes don't accept new commands while an erase is ongoing.
Make sure to wait until the device is ready before writing the marker.

Just as with the erase op, no error check is performed since we want
to continue writing the marker even if the erase fails.

Signed-off-by: Emil Lenngren <emil.lenngren@gmail.com>
---
 drivers/mtd/nand/spi/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 479c2f2cf1..c2724d34e6 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -685,6 +685,8 @@ static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos)
 
 	spinand_erase_op(spinand, pos);
 
+	spinand_wait(spinand, NULL);
+
 	memset(spinand->oobbuf, 0, 2);
 	return spinand_write_page(spinand, &req);
 }
-- 
2.17.1

             reply	other threads:[~2018-12-21 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21 11:58 Emil Lenngren [this message]
2019-01-05 13:58 ` [PATCH] mtd: spinand: Wait after erase in spinand_markbad Boris Brezillon
2019-01-06  6:01   ` Emil Lenngren
2019-01-06  8:10     ` Boris Brezillon
2019-02-18 11:27       ` Emil Lenngren
2019-02-20  7:59         ` Boris Brezillon
2019-03-04 11:23         ` Miquel Raynal
2019-03-04 11:55           ` Emil Lenngren
2019-03-04 12:50             ` Miquel Raynal

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=20181221115831.9595-1-emil.lenngren@gmail.com \
    --to=emil.lenngren@gmail.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=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    /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).