All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Barada <peter.barada@gmail.com>
To: dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org
Subject: Re: Preventing JFFS2 partial page writes?
Date: Wed, 22 Jun 2011 11:28:54 -0400	[thread overview]
Message-ID: <4E020A36.6070708@gmail.com> (raw)
In-Reply-To: <1308722655.18119.40.camel@sauron>

On 06/22/2011 02:04 AM, Artem Bityutskiy wrote:
> On Tue, 2011-06-14 at 12:19 -0400, Peter Barada wrote:
>> I'm using a Micron 512MB NAND which has an internal 4-bit ECC engine,
>> and am finding lots of ECC errors while using JFFS2.  The same NAND
>> works find using YAFFS so I know the underlying MTD driver works properly.
>>
>> The big question I have is whether JFFS2 does partial page writes and if
>> so how to disable them.
> JFFS2 does not use sub-pages so it should never do partial writes. I
> think the ECC errors you see are because of JFFS2 using OOB area to
> store clean markers.
Sorry for using the wrong terminology - I assumed a "partial write" is 
where data/oob information is written into a page multiple times.

Yes, the issue I'm seeing is that JFFS2 writes into the OOB area into
bytes that perturb the ECC, then writes data (w/o OOB) and the next read 
fails.  Googling around I see GETECCLAYOUT is now obsolete, so it 
doesn't look like extending the structure returned from it is not the 
way to go.

I'm thinking a new ioctl (and data in the kernel accessible to the NAND 
FS layers) is needed (GETOOBLAYOUT?) that returns the oobfree array, as 
well as other arrays in a structure:
1) which OOB bytes perturb the data ECCs,
2) which OOB bytes are ECC'd (within the OOB area and separate from the 
data ECCs).

I think given the new large-sized NAND that these lists will have to be 
dynamic (and another GETOOBLAYOUTSIZE ioctl call to return its size) to 
prevent moving massive structure to userspace).

Then userspace can figure out:

1) what bytes can be written in the OOB.
2) what bytes in the OOB can only be written as part of a data write (or 
sub-page write)
3) if no OOB bytes are internally ECC'd(outside of those covered by a 
data area ECC) then the code needs to either use an ECC as part of the 
data written to the OOB, or use a bitflip-friendly way to compare the 
returned data - unless the OOB data it wants to write is part of a data 
area write.

In my initial attempt to solve this I ran into the issue (in 
linux-2.6.32) that nand_transfer_oob/nand_fill_oob make the assumption 
that chip->ecc.layout->oobfree is *always* zero terminated (I needed 
eight entries to describe my OOB area).  I'll put together a patch 
against the latest kernel and send it along.

Thoughts?

-- 
Peter Barada
peter.barada@gmail.com

  reply	other threads:[~2011-06-22 15:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-14 16:19 Preventing JFFS2 partial page writes? Peter Barada
2011-06-22  6:04 ` Artem Bityutskiy
2011-06-22 15:28   ` Peter Barada [this message]
2011-06-22 17:07     ` Ivan Djelic
2011-06-22 19:17       ` Peter Barada
2011-06-22 20:06         ` Ivan Djelic
2011-06-24 15:09           ` Peter Barada
2011-06-24 19:26     ` Artem Bityutskiy
2011-06-27 14:31       ` Peter Barada
2011-06-28  9:34         ` Artem Bityutskiy
2011-06-28  9:39           ` Artem Bityutskiy
2011-07-01 20:48             ` Ivan Djelic
2011-07-04  6:27               ` Artem Bityutskiy
2011-06-28 18:56           ` Peter Barada
2011-06-29  6:33             ` Artem Bityutskiy
2011-06-30 18:05               ` Peter Barada
2011-07-01 20:52                 ` Ivan Djelic
2011-07-20 15:02                   ` Peter Barada

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=4E020A36.6070708@gmail.com \
    --to=peter.barada@gmail.com \
    --cc=dedekind1@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.