From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jan Luebbe <jlu@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] nand_write: initialize OOB buffer for each page
Date: Mon, 4 Feb 2013 14:33:53 +0100 [thread overview]
Message-ID: <20130204133353.GJ1906@pengutronix.de> (raw)
In-Reply-To: <1359620502-27551-1-git-send-email-jlu@pengutronix.de>
On Thu, Jan 31, 2013 at 09:21:42AM +0100, Jan Luebbe wrote:
> Previously, during a multi-page write, chip->oob_poi would not be
> reinitialized.
>
> See commit f722013ee9fd24623df31dec9a91a6d02c3e2f2f in the kernel
> for an analogous change.
>
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Applied, thanks
Sascha
> ---
> drivers/mtd/nand/nand_write.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/nand/nand_write.c b/drivers/mtd/nand/nand_write.c
> index 9997127..276728c 100644
> --- a/drivers/mtd/nand/nand_write.c
> +++ b/drivers/mtd/nand/nand_write.c
> @@ -296,10 +296,6 @@ 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;
> @@ -315,8 +311,12 @@ int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
> wbuf = chip->buffers->databuf;
> }
>
> - if (unlikely(oob))
> + if (unlikely(oob)) {
> oob = nand_fill_oob(chip, oob, ops);
> + } else {
> + /* We still need to erase leftover OOB data */
> + memset(chip->oob_poi, 0xff, mtd->oobsize);
> + }
>
> ret = chip->write_page(mtd, chip, wbuf, page, cached,
> (ops->mode == MTD_OOB_RAW));
> --
> 1.7.10.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2013-02-04 13:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 8:21 Jan Luebbe
2013-02-04 13:33 ` Sascha Hauer [this message]
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=20130204133353.GJ1906@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jlu@pengutronix.de \
/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