mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] nand_write: initialize OOB buffer for each page
@ 2013-01-29  9:58 Jan Luebbe
  2013-01-29  9:58 ` [PATCH 2/2] nand_omap_gpmc: use 0x00 for ECC padding in BCH ROM mode Jan Luebbe
  2013-01-30 21:52 ` [PATCH 1/2] nand_write: initialize OOB buffer for each page Sascha Hauer
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Luebbe @ 2013-01-29  9:58 UTC (permalink / raw)
  To: barebox

Previously, during a multi-page write, chip->oob_poi would not be
reinitialized.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 drivers/mtd/nand/nand_write.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c
index 9997127..f4f2fed 100644
--- a/drivers/mtd/nand/nand_write.c
+++ b/drivers/mtd/nand/nand_write.c
@@ -296,15 +296,15 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
 	    (chip->pagebuf << chip->page_shift) < (to + ops->len))
 		chip->pagebuf = -1;
 
-	/* Initialize to all 0xFF, to avoid the possibility of
-	   left over OOB data from a previous OOB read. */
-	memset(chip->oob_poi, 0xff, mtd->oobsize);
-
 	while(1) {
 		int bytes = mtd->writesize;
 		int cached = writelen > bytes && page != blockmask;
 		uint8_t *wbuf = buf;
 
+		/* Initialize to all 0xFF, to avoid the possibility of
+		   left over OOB data from a previous OOB read or write. */
+		memset(chip->oob_poi, 0xff, mtd->oobsize);
+
 		/* Partial page write ? */
 		if (unlikely(column || writelen < (mtd->writesize - 1))) {
 			cached = 0;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-30 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-29  9:58 [PATCH 1/2] nand_write: initialize OOB buffer for each page Jan Luebbe
2013-01-29  9:58 ` [PATCH 2/2] nand_omap_gpmc: use 0x00 for ECC padding in BCH ROM mode Jan Luebbe
2013-01-30 21:52   ` Sascha Hauer
2013-01-30 21:52 ` [PATCH 1/2] nand_write: initialize OOB buffer for each page Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox