From: Charles Manning <manningc2@actrix.gen.nz>
To: linux-mtd@lists.infradead.org
Subject: Proposal: allow reading oob with AUTOPLACE
Date: Wed, 19 Oct 2005 14:08:38 +1300 [thread overview]
Message-ID: <200510191408.38536.manningc2@actrix.gen.nz> (raw)
Hi folks
As has been discussed in various places, it would be nice to be able to read
oob with AUTOPLACE, without reading the whole data page too. At present there
is no way to do this.
Having this capability is quite important to YAFFS2 since it allows the tags
(in oob) to be scanned without having to do the extra (useless) work of
dummy-reading the data. Currently people have to manually fiddle around to
get the required semantics.
There are three ways I can see to achieve this:
1) Change the semantics of read_oob(). That would work, but would break anyone
expecting read_oob() to have its current semantics of reading raw.
2) Change read_oob() to take an oobsel argument to allow reading raw or
AUTOPLACE or whatever. That would break some code, but very little. At least
it would be obvious where something needs fixing (whereas (1) does not make
it obvious).
3) Change read_ecc() to allow passing in a NULL data buf pointer to indicate
that only the oob should be read.
Personally, I think 2 is neatest from an interface perspective, but 3 breaks
the least and 1 is the worst because semantics change in an uncontrolled way.
However, this is a personal taste issue and I will be happy with any solution
that gives the function.
I have below an**untested** patch for option 3 - sorry folk; no hw == no test.
I wrote this with the intent of seeing how traumatic the changes might be,
rather than try build shippable code.
I expect the patch does not conform to guidelines, but I hope not to get a
public flogging.
diff /opt/mtd_virgin/drivers/mtd/nand/nand_base.c /opt/mtd/drivers/mtd/nand/nand_base.c
1118a1119
> int oob_only, oob_once;
1147a1149,1150
> oob_once = oob_only = (!buf); /* buf is NULL, so only reading OOB */
>
1174c1177
< while (read < len) {
---
> while (read < len || oob_once) {
1200c1203
< this->cmdfunc (mtd, NAND_CMD_READ0, 0x00, page);
---
> this->cmdfunc (mtd, (oob_only) ? NAND_CMD_READOOB :
NAND_CMD_READ0, 0x00, page);
1201a1205
> oob_once = 0;
1208a1213
>
1210a1216,1218
> if(oob_only)
> goto read_oob_data;
>
1256a1265
> read_oob_data:
1260c1269
< if (!compareecc)
---
> if (!compareecc || oob_only)
reply other threads:[~2005-10-19 1:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200510191408.38536.manningc2@actrix.gen.nz \
--to=manningc2@actrix.gen.nz \
--cc=linux-mtd@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