From: Todd Poynor <tpoynor@mvista.com>
To: Vitaly Wool <vwool@ru.mvista.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd/utils: sync with MTD ioctl interface rework to get rid of MEMGETOOBSEL/MEMSETOOBSEL
Date: Fri, 02 Dec 2005 14:06:10 -0800 [thread overview]
Message-ID: <4390C552.60907@mvista.com> (raw)
In-Reply-To: <438FF22A.2060203@ru.mvista.com>
Hi Vitaly, my comments...
> +++ util/nanddump.c 2 Dec 2005 06:54:11 -0000
> @@ -163,6 +163,7 @@
> struct mtd_oob_buf oob = {0, 16, oobbuf};
> mtd_info_t meminfo;
> char pretty_buf[80];
> + uint32_t oobavail;
>
> process_options(argc, argv);
>
> @@ -179,6 +180,13 @@
> exit (1);
> }
>
> + if (ioctl(fd, MEMGETOOBAVAIL, &oobavail) != 0) {
> + perror("unable to get NAND oobavail");
> + close(fd);
> + exit(1);
> + }
How about fall back to all 16/64/etc. avail?
For debugging purposes it can be nice to see the raw OOB, in case that
can be shoehorned in here somehow.
> +++ util/nandwrite.c 2 Dec 2005 06:54:11 -0000
> - " -j, --jffs2 force jffs2 oob layout (legacy support)\n"
> - " -y, --yaffs force yaffs oob layout (legacy support)\n"
Again, it may be good to keep a legacy mode around during the transition
period.
> if (writeoob) {
> /* Read OOB data from input file, exit on failure */
> - if ((cnt = read(ifd, oobreadbuf, meminfo.oobsize)) != meminfo.oobsize) {
> + if ((cnt = read(ifd, oobreadbuf, oobavail)) != oobavail) {
This requires the input file to be tailored to the oobavail of a
specific destination device, reducing the benefit of autoplacement. It
may be best to continue to pad input files oob data to the full oobsize,
much like the data portion is handled.
> + memcpy(oobbuf, oobreadbuf, oobavail);
No need for oobreadbuf and copy if no OOB layout processing done anymore?
--
Todd
next prev parent reply other threads:[~2005-12-02 22:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 7:05 [PATCH] mtd/utils: sync with MTD ioctl interface rework to get rid of MEMGETOOBSEL/MEMSETOOBSEL Vitaly Wool
2005-12-02 22:06 ` Todd Poynor [this message]
2005-12-05 5:46 ` Vitaly Wool
2005-12-13 0:02 ` Todd Poynor
2005-12-13 0:20 ` Thomas Gleixner
2005-12-06 10:30 ` Thomas Gleixner
2005-12-06 10:36 ` Vitaly Wool
2005-12-06 10:51 ` Thomas Gleixner
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=4390C552.60907@mvista.com \
--to=tpoynor@mvista.com \
--cc=linux-mtd@lists.infradead.org \
--cc=vwool@ru.mvista.com \
/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