From: Jan Luebbe <jlu@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] nand_write: initialize OOB buffer for each page
Date: Tue, 29 Jan 2013 10:58:01 +0100 [thread overview]
Message-ID: <1359453482-6583-1-git-send-email-jlu@pengutronix.de> (raw)
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
next reply other threads:[~2013-01-29 9:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 9:58 Jan Luebbe [this message]
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
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=1359453482-6583-1-git-send-email-jlu@pengutronix.de \
--to=jlu@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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