* Bad Block management routine for MTD NandFlash driver?
@ 2002-06-17 8:04 Jason Chan
2002-06-17 8:22 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Jason Chan @ 2002-06-17 8:04 UTC (permalink / raw)
To: linux-mtd
Hi all,
Any bad block management routine (eg. Invalid block table ) is
implemented for MTD NandFlash driver?
It seems that the ECC routine is not enough for my nandflash driver. And
I need a more robust bad block management routine for that. Should I
implement the invalid block table by myself, or there are some already
implemented?
--
Best Regards,
Jason Chan
Emsoft Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Bad Block management routine for MTD NandFlash driver?
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
0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2002-06-17 8:22 UTC (permalink / raw)
To: Jason Chan; +Cc: linux-mtd
jason@emsoftltd.com said:
> Any bad block management routine (eg. Invalid block table ) is
> implemented for MTD NandFlash driver? It seems that the ECC routine is
> not enough for my nandflash driver. And I need a more robust bad
> block management routine for that.
The low-level hardware driver does not implement and bad block management.
That is done by whatever file system or translation layer you use on the
flash. What are you intending to use? JFFS2?
--
dwmw2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bad Block management routine for MTD NandFlash driver?
2002-06-17 8:22 ` David Woodhouse
@ 2002-06-17 8:28 ` Jason Chan
2002-06-17 8:41 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Jason Chan @ 2002-06-17 8:28 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
David,
I trying to use EXT2 for my nandflash driver. Is that OK?
When I make a EXT2 file system on the nandflash driver, the
mtd/nand/nand.c show a error message that "nand_erase: Failed erase",
and it keep looping the same statement.
Since I may use other filesystem in the future, eg. CRAMFS or VFAT, I
have no idea on the completeness of the filesystem on the bad block
managment. So how can enable use the translation layer to manage my bad
block?
David Woodhouse wrote:
>jason@emsoftltd.com said:
>
>> Any bad block management routine (eg. Invalid block table ) is
>>implemented for MTD NandFlash driver? It seems that the ECC routine is
>>not enough for my nandflash driver. And I need a more robust bad
>>block management routine for that.
>>
>
>The low-level hardware driver does not implement and bad block management.
>That is done by whatever file system or translation layer you use on the
>flash. What are you intending to use? JFFS2?
>
>--
>dwmw2
>
>
--
Best Regards,
Jason Chan
Emsoft Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Bad Block management routine for MTD NandFlash driver?
2002-06-17 8:28 ` Jason Chan
@ 2002-06-17 8:41 ` David Woodhouse
2002-06-17 8:43 ` Jason Chan
0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2002-06-17 8:41 UTC (permalink / raw)
To: Jason Chan; +Cc: linux-mtd
jason@emsoftltd.com said:
> I trying to use EXT2 for my nandflash driver. Is that OK?
No. You need _some_ kind of file system which is capable of dealing with
flash -- either a real file system directly on the flash such as JFFS2, or
a 'translation layer' like the SmartMedia one or NFTL if you really need to
use ext2 for some reason.
--
dwmw2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bad Block management routine for MTD NandFlash driver?
2002-06-17 8:41 ` David Woodhouse
@ 2002-06-17 8:43 ` Jason Chan
2002-06-17 9:03 ` David Woodhouse
0 siblings, 1 reply; 6+ messages in thread
From: Jason Chan @ 2002-06-17 8:43 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
David,
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?
David Woodhouse wrote:
>jason@emsoftltd.com said:
>
>> I trying to use EXT2 for my nandflash driver. Is that OK?
>>
>
>No. You need _some_ kind of file system which is capable of dealing with
>flash -- either a real file system directly on the flash such as JFFS2, or
>a 'translation layer' like the SmartMedia one or NFTL if you really need to
>use ext2 for some reason.
>
>--
>dwmw2
>
>
--
Best Regards,
Jason Chan
Emsoft Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Bad Block management routine for MTD NandFlash driver?
2002-06-17 8:43 ` Jason Chan
@ 2002-06-17 9:03 ` David Woodhouse
0 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2002-06-17 9:03 UTC (permalink / raw)
To: Jason Chan; +Cc: linux-mtd
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-06-17 9:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox