public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: David Updegraff <dave@cray.com>
To: linux-mtd@lists.infradead.org
Subject: Re: nand oob layout assumptions
Date: Sat, 27 Mar 2004 10:13:15 -0600	[thread overview]
Message-ID: <4065A81B.6020607@cray.com> (raw)
In-Reply-To: <1080386714.17352.52.camel@imladris.demon.co.uk>

In all this discussion, the need for anyone outside the driver to know
hardware positions of ECC and badblock markers still elludes me.  Yes, 
various FS need to scribble oob info of their own in a particular 
format, and in a way that won't scribble over ecc/badblock, but is there 
anything more than that?

So, again, what if the 'oobsize' and 'oob_buf' (or a renamed relative 
thereof) were interpreted to mean "region available in OOB for misc. 
file system housekeeping, that will not stomp on private ECC or badblock 
areas and will not be interpreted by nand driver".  And let the driver 
put it wherever it wants/needs to in OOB.  Driver gets to ignorant of FS 
details, FS gets to be ignorant of chip-HW-dependent ECC and badblock 
layout.

>>What else would you need ? 
> 
> 
> Nothing more, but it does live where it is in the hardware driver.
> 
> 
>>I'm not happy to build in the bad block bitmap stuff as a general solution. 
>>Next will be translation tables, bad block remapping and all kind of crap, 
>>which is not neccecary to run a NAND FLASH aware filesystem. 
> 
> 
> We don't need to build it in as a general solution -- the DiskOnChip
> code will do it itself. All we need to do is keep the API sufficiently
> versatile that the FS doesn't need to know about the peculiarities of
> the DiskOnChip -- it just gets told which bytes of the OOB area it can
> use, and does so.
> 
> The DiskOnChip uses the first 6 bytes of the OOB area for hardware ECC,
> and bad block information is elsewhere on the medium.
> 
> 
>>The NAND specs have defined to have the bad block markers in the OOB area, 
>>which is quite clever, as it does not restrict the usage of any byte in the 
>>main area.
> 
> 
> No, the NAND specs have defined the bad block markers to be in the OOB
> area when the device is shipped. What you do with it after that is up to
> you. And in the case of the DiskOnChip that means the bad block
> information is moved. We _really_ want to honour that and keep it within
> the hardware driver. I don't want any possibility of erasing bad blocks,
> and I'm not overly happy with thinking non-bad blocks are bad just
> because the device has already been used with NFTL and has ECC data in
> byte 5.
> 
> 
>>Nand.c needs bad block handling in the sense of preventing erase of bad 
>>blocks. Maybe the prevention of reading / writing bad blocks too. And the 
>>possibility to have a bad block detection function, which covers specific 
>>cases like DOC.
>>
>>But this does not change the interface. 
> 
> 
> Except that in the file system we need to call the device's
> ->is_bad_block() function rather than poking at the OOB area.
>  
> 
>>ECC positions are a totaly different thing. If we want to have a fixed scheme 
>>for storing ECC bytes, which is not neccecary even with hardware ECC, as the 
>>hardware ECC only does the ECC calculation and no placing of ECC data into 
>>OOB, 
> 
> 
> On the DiskOnChip I think it has to be the first six bytes of the OOB.
> You read <data + ECC> and check a _bit_ to see if there was an error.
> You don't read the ECC syndrome and compare with what you separately
> read from the medium.
> 
> 
>>then we have to use _ONE_ final ECC placement scheme for all filesystems 
>>and therefor we can only use the SmartmediaCard layout, as doing not so would 
>>prevent the development of a SmartMedia FAT fs driver. This would break YAFFS 
>>support complete. JFFS2 uses the SmartMedia layout anyway.
> 
> 
> We don't need a fixed ECC scheme. But we do need to tell the file system
> what we support. Those should include the SmartMedia software ECC, and
> may include the DiskOnChip hardware ECC too. 
> 
> JFFS2 uses the DiskOnChip ECC on DiskOnChip already, doesn't it?
> 
> 
>>>Other than noticing them and avoiding them, there really isn't much
>>>handling to be done.
>>
>>True, but it still is a job of the filesystem and therefor it must have access 
>>to this information.
> 
> 
> Yes. It _absolutely_ needs access to the information 'is this a bad
> block?'. What it doesn't need is stuff like "what byte in the OOB area
> would tell us if this was a bad block".
> 

  parent reply	other threads:[~2004-03-27 16:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-25 18:44 nand oob layout assumptions David Updegraff
2004-03-25 19:58 ` Thomas Gleixner
2004-03-27  7:40   ` Charles Manning
2004-03-27  8:07     ` Thomas Gleixner
2004-03-27 10:24       ` David Woodhouse
2004-03-27 11:10         ` Thomas Gleixner
2004-03-27 11:25           ` David Woodhouse
2004-03-27 14:15             ` Thomas Gleixner
2004-03-27 16:13             ` David Updegraff [this message]
2004-03-27 16:18               ` David Woodhouse
2004-03-27 17:40                 ` Thomas Gleixner
2004-03-28  8:06                 ` Charles Manning
2004-03-28  8:05                   ` Thomas Gleixner
2004-03-28  7:34       ` Charles Manning
2004-03-28  7:51         ` Thomas Gleixner
2004-03-28  8:19           ` Charles Manning

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=4065A81B.6020607@cray.com \
    --to=dave@cray.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox