From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gaJW3-0006Cx-S0 for linux-mtd@lists.infradead.org; Fri, 21 Dec 2018 12:02:57 +0000 Received: by mail-lf1-x141.google.com with SMTP id z13so3713071lfe.11 for ; Fri, 21 Dec 2018 04:02:44 -0800 (PST) From: Emil Lenngren To: linux-mtd@lists.infradead.org Cc: Emil Lenngren , Boris Brezillon , Miquel Raynal , Richard Weinberger , David Woodhouse , Brian Norris , Marek Vasut Subject: [PATCH] mtd: spinand: Wait after erase in spinand_markbad Date: Fri, 21 Dec 2018 12:58:14 +0100 Message-Id: <20181221115831.9595-1-emil.lenngren@gmail.com> List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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