From: David Woodhouse <dwmw2@infradead.org>
To: Jason Chan <jason@emsoftltd.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: Bad Block management routine for MTD NandFlash driver?
Date: Mon, 17 Jun 2002 10:03:42 +0100 [thread overview]
Message-ID: <19702.1024304622@redhat.com> (raw)
In-Reply-To: <3D0DA13D.70803@emsoftltd.com>
jason@emsoftltd.com said:
> Sorry, I don't fully understand your 2nd suggestion, 'translation
> layer' like the SmartMedia one. Is that means the smartmedia mtd
> driver already has bad block management?
You need more than just bad block management. You need a complete file
system, to give you wear levelling and reliable operation.
The 'mtdblock' driver is not meant for read/write use in normal
circumstances. When you write a sector to the 'mtdblock' device, it reads
the whole erase block from the flash, modifies the sector you wanted to
change, erases the flash erase block and writes back the modified data.
If you lose power or crash between the erase and the writeback, you lose a
whole erase block of data, not just the sector you were overwriting. And
there's no wear levelling -- so some blocks will be worn to the point of
destruction while others still have plenty of life.
You must have some kind of file system on the flash, whether that's a real
file system such as JFFS2 or a pseudo-filesystem like SmartMedia or NFTL
which emulates a block device, on top of which you put a 'normal' file
system.
We don't yet have an implementation of the SmartMedia translation layer in
CVS, although I think someone _has_ implemented it. NFTL has patent issues
so I wouldn't advise using that. In fact, emulating a block device is
the wrong approach entirely -- it's no longer justifiable now that we're
not using DOS, and you should probably be using JFFS2.
JFFS2 recognises bad blocks during the medium scan at mount time, and
does not keep a separate table of bad blocks. If this approach is
insufficient, patches are welcome.
--
dwmw2
prev parent reply other threads:[~2002-06-17 9:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-17 8:04 Bad Block management routine for MTD NandFlash driver? Jason Chan
2002-06-17 8:22 ` David Woodhouse
2002-06-17 8:28 ` Jason Chan
2002-06-17 8:41 ` David Woodhouse
2002-06-17 8:43 ` Jason Chan
2002-06-17 9:03 ` David Woodhouse [this message]
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=19702.1024304622@redhat.com \
--to=dwmw2@infradead.org \
--cc=jason@emsoftltd.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