From: Mike Dunn <mikedunn@newsguy.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Shmulik Ladkani <shmulik.ladkani@gmail.com>,
prabhakar@freescale.com
Subject: Re: [PATCH 1/2] mtd: nand: add OOB argument to NAND {read, write}_page interfaces
Date: Fri, 20 Apr 2012 09:17:24 -0700 [thread overview]
Message-ID: <4F918C14.8070004@newsguy.com> (raw)
In-Reply-To: <CAN8TOE_u9or8b+ZapRqD8XwV8abUDNXBtmAeBwDNiZ8aAs-Mdw@mail.gmail.com>
Hi Brian,
On 04/19/2012 03:06 PM, Brian Norris wrote:
> Hi Mike,
>
> On Thu, Apr 19, 2012 at 9:50 AM, Mike Dunn <mikedunn@newsguy.com> wrote:
>> On 04/17/2012 08:44 PM, Brian Norris wrote:
>>
>>> Now, in future revisions of this ASIC, it may be possible to access
>>> OOB via DMA as well, but even if this happens, it doesn't make a lot
>>> of sense on this hardware to *always* pull OOB data.
>>
>>
>> No, it doesn't. In fact, I'm not aware of any code within or on top of mtd that
>> does anything with the oob data when a page is read. If oob is needed,
>> mtd_read_oob() is used.
>
> I guess this may not be an issue for page read, but I know one use for
> write_page data+OOB. MLC NAND, for instance, requires that you write
> *once* to a page, so I introduced ioctl(MEMWRITE) which generically
> allows page, OOB, or both to be written. This trickles down to the
> nand_ecc_ctrl.write_page function, I think. There are probably other
> cases that I'm not really thinking of right now.
I was just thinking of read.
>
>> Coincidentally, I recxently discovered that my docg4
>> driver is technically broken because I don't fill the chip->oob_poi buffer when
>> I read a page, but it never caused a problem with UBI/ubifs.
>
> If, as you claim, chip->oob_poi is never used on page read, then why
> do you claim this is "broken" for docg4? (Note that I am not 100% sure
> of your claim. There are *potential* users through the mtd_read_oob()
> API, which can specify both oobbuf and datbuf.)
Broken because it's *supposed* to fill it, creating the *potential* users, as
you point out. My point was just to illustrate that you are correct: the need
to read oob along with the page data need not be assumed.
>
>> And the mtdutils
>> are fine because mtdchar requires use of an ioctl for oob access, and the
>> handler for this ioctl uses mtd_read_oob().
>>
>>> As mentioned
>>> previously, most normal applications (i.e., UBI(FS)) don't need to
>>> access this OOB data at all, so it seems silly to go to extra work to
>>> have the DMA controller return it to the MTD/NAND layers. I'm not
>>> familiar with the OOB/ECC schemes on enough other hardware to
>>> determine whether other drivers could make use of this same
>>> optimization. It would require hardware with internal buffers for
>>> error correction and an access mode that easily returns page data
>>> only...
>>
>>
>> The Freescale nand controllers might fall into this category. Hardware handles
>> error detction *and* correction, so there's no need to read the oob at all if
>> it's not needed. And fsl_ifc_nand was just mainlined, BTW.
>
> Right, I noticed the new driver (merge in 3.4-rc, right?) but didn't
> study the details. From your description, it sounds like it could use
> this change. CC'ing Prabhakar, author of fsl_ifc_nand.c.
>
> And have you seen the thread (on patch 2/2) in which Shmulik suggests
> using a boolean (has_oob) argument instead of a buffer (oob) argument?
> Unless there are objections, I plan to rewrite v2 under his
> suggestion.
Yes (after sending my post). I think it's a very good suggestion. Keeps the
code from becoming even more confusing than it already is.
>
> Thanks for your thoughts!
>
> Brian
>
> P.S. It seems, Mike, like you dropped the CC list. This may or may not
> be intentional, but either way I suppose this discussion isn't
> particularly important for all the CC'd members...
Done because my smtp server has a recipient limit of 20 :( Otherwise I would
have "replied all".
Thanks,
Mike
next prev parent reply other threads:[~2012-04-20 16:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 22:35 [PATCH 0/2] mtd: nand: rework nand_ecc_ctrl interface for OOB Brian Norris
2012-04-16 22:35 ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read, write}_page interfaces Brian Norris
2012-04-17 7:50 ` Matthieu CASTET
2012-04-18 3:44 ` Brian Norris
2012-04-19 16:50 ` Mike Dunn
2012-04-19 22:06 ` Brian Norris
2012-04-20 1:10 ` Jon Povey
2012-04-20 16:25 ` Mike Dunn
2012-04-20 19:19 ` Brian Norris
2012-04-20 16:17 ` Mike Dunn [this message]
2012-04-22 7:58 ` Shmulik Ladkani
2012-04-23 9:14 ` Bastian Hecht
2012-04-23 17:14 ` Mike Dunn
2012-04-24 6:02 ` Shmulik Ladkani
2012-04-25 13:17 ` Bastian Hecht
2012-04-17 14:29 ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read,write}_page interfaces Shmulik Ladkani
2012-04-18 4:11 ` [PATCH 1/2] mtd: nand: add OOB argument to NAND {read, write}_page interfaces Brian Norris
2012-04-18 7:56 ` Bastian Hecht
2012-04-18 9:37 ` Bastian Hecht
2012-04-18 16:22 ` Brian Norris
2012-04-19 9:26 ` Bastian Hecht
2012-04-16 22:35 ` [PATCH 2/2] mtd: nand: nand_do_{read, write}_ops - pass OOB buffer through Brian Norris
2012-04-18 11:52 ` [PATCH 2/2] mtd: nand: nand_do_{read,write}_ops " Shmulik Ladkani
2012-04-18 16:13 ` [PATCH 2/2] mtd: nand: nand_do_{read, write}_ops " Brian Norris
2012-04-18 19:43 ` [PATCH 2/2] mtd: nand: nand_do_{read,write}_ops " Shmulik Ladkani
2012-04-25 14:16 ` [PATCH 0/2] mtd: nand: rework nand_ecc_ctrl interface for OOB Artem Bityutskiy
2012-04-25 18:26 ` Brian Norris
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=4F918C14.8070004@newsguy.com \
--to=mikedunn@newsguy.com \
--cc=computersforpeace@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=prabhakar@freescale.com \
--cc=shmulik.ladkani@gmail.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;
as well as URLs for NNTP newsgroup(s).