public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <gleixner@autronix.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: <linux-mtd@lists.infradead.org>, <jffs-dev@axis.com>
Subject: Re: NAND flash and JFFS(2)
Date: Mon, 11 Feb 2002 14:42:57 +0100	[thread overview]
Message-ID: <02021114425704.00764@thomas> (raw)
In-Reply-To: <Pine.LNX.4.44.0202071703480.11698-100000@lapdancer.baythorne.internal>

On Thursday,  7. February 2002 08:04, David Woodhouse wrote:
> On Thu, 7 Feb 2002, Thomas Gleixner wrote:
> > I mean we should keep the batch write. Thats correct. But we can leave
> > the cleanmarker where it is now and write it without ECC and put the rest
> > of the page with ECC. On small NAND devices we have only 8byte spare area
> > per block. We need 3 byte for ECC and at least 1 byte for flags. Then the
> > cleanmarker area is reduced to 4 bytes. Is that enough ?
>
> Yeah, that's fine. We can do either - I'm not sure it matters too much.

I'm going to merge your current CVS code with my wbuf changes. 
But we should decide what to do with the cleanmarker stuff and the usage of 
the spare area.
On devices with 512 byte pagesize we have a spare area of 16 byte. On smaller 
devices with 256 byte pagesize we have only 8 byte.
We have already some layouts for the spare area:
DOC
Byte 0-5	ECC
Byte 6-7	block used status (0x55,0x55)
Byte 8-15	not assigned

SmartMediaCard 256 Byte pagesize
Byte 0-5	not assigned
Byte 6		bad block status
Byte 7		not assigned

SmartMediaCard 512 Byte pagesize
Byte 0-5	not assigned
Byte 6		bad block status
Byte 7		not assigned
Byte 8-15	not assigned

Raw Nand Chips 256 Byte pagesize
Byte 0-7	not assigned

Raw Nand Chips 512 Byte pagesize
Byte 0-15	not assigned

The bad block status on the SmartMediaCards is programmed to a value 
different to 0xff by the manufacturer. We should use this too. 
Bad blocks on raw NAND chips are marked by values different to 0xff in the 
first two pages of a block. 
I don't know, if there's a similar technique on DOC.

I think the SmartMedia bad block indication is much more convenient than the 
raw NAND solution. May be we can implement a utility to move the bad block 
info into the spare area on raw NAND chips, so the bad block indication would 
be the same. This could also be done at production time or be part of a 
bootloader, because it has to done only once. 
The nand driver should exclude these blocks from erase/write to keep this 
information intact. But then we should read the bad block information at 
mount time too. This can easily be done with the read_cleanmarker_oob 
function. If we detect a bad block during operation, we could mark it the 
same way, so the block is excluded for ever. 

Layout with cleanmarker in spare area:
DOC
Byte 0-5	ECC
Byte 6-7	block used status (0x55,0x55) or bad block (value != 0x55 && != 0xff)
Byte 8-15	cleanmarker

SmartMedia and raw NAND 512 Byte pagesize
Byte 0-5	ECC
Byte 6		bad block status
Byte 7 		page data valid flag
Byte 8-15	cleanmarker

SmartMedia and raw NAND 256 Byte pagesize
Byte 0-2	ECC for even page
Byte 3-5	cleanmarker
Byte 6		bad block status
Byte 7		page data valid flag

Some information about the current state. I ran a 24h test with copying, 
moving, deleting files with random power down. The filesystem is clean and we 
have no data loss except some broken files on powerdown. But nothing in the 
world can help, if we write a new file and loose power before we finished it.

Thomas
__________________________________________________
Thomas Gleixner, autronix automation GmbH
auf dem berg 3, d-88690 uhldingen-muehlhofen
fon: +49 7556 919891 , fax: +49 7556 919886
mail: gleixner@autronix.de, http://www.autronix.de  

  reply	other threads:[~2002-02-11 13:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <02020523405103.11497@thomas>
2002-02-06  4:54 ` NAND flash and JFFS(2) David Woodhouse
2002-02-06 22:47   ` Thomas Gleixner
2002-02-06 22:55     ` David Woodhouse
2002-02-07  6:51       ` Thomas Gleixner
2002-02-07  7:04         ` David Woodhouse
2002-02-11 13:42           ` Thomas Gleixner [this message]
2002-02-11 13:53             ` David Woodhouse
     [not found]               ` <0202121847440K.00764@thomas>
2002-02-13 11:40                 ` Thomas Gleixner
2002-02-13 20:03 Lance Nakamura
2002-02-13 20:19 ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2002-02-11 23:42 Steve_Chen
2002-02-12  0:10 ` Thomas Gleixner
2002-02-11 15:32 Thomas Gleixner
2002-02-11 15:48 ` Thomas Gleixner
2002-02-11 19:28   ` Thomas Gleixner
2002-02-05 14:41 Veli-Pekka Ylönen
2002-02-05 15:30 ` David Woodhouse
2002-02-05 17:28   ` Thomas Gleixner
2002-02-05 21:18     ` David Woodhouse
2002-02-05 17:35   ` Veli-Pekka Ylönen

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=02021114425704.00764@thomas \
    --to=gleixner@autronix.de \
    --cc=dwmw2@infradead.org \
    --cc=jffs-dev@axis.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