From patchwork Mon Jun 22 13:16:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikhail Kshevetskiy X-Patchwork-Id: 242754 List-Id: U-Boot discussion From: mikhail.kshevetskiy at oktetlabs.ru (Mikhail Kshevetskiy) Date: Mon, 22 Jun 2020 16:16:32 +0300 Subject: [PATCH 2/4] mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB In-Reply-To: <20200622131634.2132717-1-mikhail.kshevetskiy@oktetlabs.ru> References: <20200622131634.2132717-1-mikhail.kshevetskiy@oktetlabs.ru> Message-ID: <20200622131634.2132717-2-mikhail.kshevetskiy@oktetlabs.ru> From: Frieder Schrempf When writing the bad block marker to the OOB area the access mode should be set to MTD_OPS_RAW as it is done for reading the marker. Currently this only works because req.mode is initialized to MTD_OPS_PLACE_OOB (0) and spinand_write_to_cache_op() checks for req.mode != MTD_OPS_AUTO_OOB. Fix this by explicitly setting req.mode to MTD_OPS_RAW. Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") Signed-off-by: Frieder Schrempf Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200218100432.32433-3-frieder.schrempf at kontron.de --- drivers/mtd/nand/spi/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 410ea2382d..c74a7b5ef3 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -708,6 +708,7 @@ static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) .ooboffs = 0, .ooblen = sizeof(marker), .oobbuf.out = marker, + .mode = MTD_OPS_RAW, }; int ret;