aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrieder Schrempf <frieder.schrempf@kontron.de>2020-02-18 10:05:25 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-23 10:38:25 +0200
commitbeb316bf97cd7d42d9b40dcc53de5bdd30216050 (patch)
treeaae922cb3eb4497f894025f2518d76ed7fd025b2
parent09766d7091c5193df8fd9852fe836fc67ef0d554 (diff)
downloadlinux-yocto-beb316bf97cd7d42d9b40dcc53de5bdd30216050.tar.gz
linux-yocto-beb316bf97cd7d42d9b40dcc53de5bdd30216050.tar.bz2
linux-yocto-beb316bf97cd7d42d9b40dcc53de5bdd30216050.zip
mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB
commit 621a7b780bd8b7054647d53d5071961f2c9e0873 upstream. 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 <frieder.schrempf@kontron.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200218100432.32433-3-frieder.schrempf@kontron.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mtd/nand/spi/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 5750c45019d8..8dda51bbdd11 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -609,6 +609,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;