public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Fw: corrupt my NAND flash device
@ 2003-04-22 20:03 Alex Samoutin
  2003-04-22 20:26 ` Jörn Engel
  2003-04-23 20:45 ` Charles Manning
  0 siblings, 2 replies; 31+ messages in thread
From: Alex Samoutin @ 2003-04-22 20:03 UTC (permalink / raw)
  To: paul.wong; +Cc: linux-mtd

>Next step, I erased the file and copied another 5 MB file to it. The
>device  said " no enough spare.

Yes. You have no all free space immediately after erasing, because garbage
collector
didn't complete his work yet.

>Then I use the "mkyaffs" to format it,
>it is shown  many bad block in the device. I checked the OOB[5] ( bad
>block flag) it is  set to 0x00. Why? Why the yaffs set the health
>block to the bad block after  erase file? Is the YAFFS not support big
>file ?  any ideal?

It's different problem. When you "erase" file it not really erased.
This file just marked for erasing and then GC working in background provede
real erasing.
So, if you erase file and start immediately write new file - you have two
processes which try
access the NAND chip at the same time (Writing and GC). NAND driver has lock
mechanism to prevent problem.
Before each physical access to chip you mast grab the lock (using
nand_get_chip()).
The code look exelent, but ..  it doesn't work! (At least in my 2.4.21-pre2
kernel.
I don't know why. And I had the same problem as you. When lock doesn't work
you can
get unpredictable result including absolutely wrong data in OOB. I quickly
fix this problem using mutex.
I've placed down() before each nand_get_chip() call and up() after
spin_unlock_bh().
It is not very elegant and, probably, not very good for kernel efficiency,
however it works.

Alexander

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Fw: corrupt my NAND flash device
@ 2003-08-18 11:36 Eugeny Mints
  0 siblings, 0 replies; 31+ messages in thread
From: Eugeny Mints @ 2003-08-18 11:36 UTC (permalink / raw)
  To: samoutin; +Cc: David Woodhouse, linux-mtd

Alex, all,

>Alex Samoutin samoutin at hotbox.ru 
>Wed Jul 2 11:43:11 BST 2003 

>Previous message: 2nd try: [PATCH] jffs2 on DOC 
>Next message: Fw: corrupt my NAND flash device 
>Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] 

>Hi Thomas,
>Sorry for big delay with answer - I had no hardware to test. Now I got
my
>CerfCube 405ep back and can play with it.
>So I had two problems

>  1.. Write verify sometimes fail
>  2.. Write operation during erase sometimes cause data corruption

Could you please describe you test which detects the first problem? I
have the same, but it arises very seldom and unstable. I'd like to be
able to reproduce the bug predictably. 

>Hardware details :
>- NAND chip Toshiba TC58256AFT
>- ALE/CLE and CE connected to GPIO
>- R/B pin connected to GPIO and I use ready function which reads it
pin.
>- I played with different timings - even slowest setting gets  me the
same
>result

>1-st problem was solved by applying new MTD snapshot  (Jun 26). It's
look
>like nand_deselect(); nand_select() fixes the problem.

It is interesting - this fix doesn't help me:( (I have MIPS Au1100 and
Toshiba TC58256AFTI ) 
More over, I discovered that fix proposed by David in the latests
(august) snapshots (reset before write command) hangs my system during
eraseall:(


>However  after applying new MTD release the 2-nd problem still
remained.
>Then I comment out erase abort in nand_get_chip (as you suggested) and
it
>fixes my second problem!
>Could you remove this erase abort from MTD source? I think it will not
>affect much on efficiency.

My second problem is that system hangs if the device is filled once and
an attempt to re-use previously used sectors is made. Comment out erase
abort in nand_get_chip fixes my second problem too.

Regards,
		Eugeny

^ permalink raw reply	[flat|nested] 31+ messages in thread
* Fw: corrupt my NAND flash device
@ 2003-04-22  7:05 Paul Wong
  0 siblings, 0 replies; 31+ messages in thread
From: Paul Wong @ 2003-04-22  7:05 UTC (permalink / raw)
  To: linux-mtd

 Hi all!
     i installed the YAFFS file system in the NAND flash (samsung 16MB). And
 test the reliability. I tried to copy a 5 MB file to the mounted yaffs
 (spare 8MB) directory ( i separated the device to 3 partition - 4MB 4MB and
 8MB) . and then check the disk space, it is shown that it has 3 MB spare.
 Next step, I erased the file and copied another 5 MB file to it. The device
 said " no enough spare. Then I use the "mkyaffs" to format it, it is shown
 many bad block in the device. I checked the OOB[5] ( bad block flag) it is
 set to 0x00. Why? Why the yaffs set the health block to the bad block after
 erase file? Is the YAFFS not support big file ?  any ideal?

 Thanks

Paul

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2003-08-18 11:37 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-22 20:03 Fw: corrupt my NAND flash device Alex Samoutin
2003-04-22 20:26 ` Jörn Engel
2003-04-22 20:59   ` Jörn Engel
2003-04-23 20:45 ` Charles Manning
2003-04-24 18:25   ` Alex Samoutin
2003-04-25 13:01     ` Jörn Engel
2003-04-25 22:23       ` Alex Samoutin
2003-04-25 23:10         ` Thayne Harbaugh
2003-04-26 10:23           ` Jörn Engel
2003-04-28 15:02             ` Thayne Harbaugh
2003-04-28 21:14               ` Charles Manning
2003-04-28 22:59                 ` Thomas Gleixner
2003-04-29  1:23                   ` Charles Manning
2003-04-29  8:03                     ` Thomas Gleixner
2003-04-29 19:37                       ` Charles Manning
2003-04-29 22:04                         ` Thomas Gleixner
2003-04-30 16:54           ` Alex Samoutin
2003-04-30 18:13             ` Thomas Gleixner
2003-07-02 17:43               ` Alex Samoutin
2003-07-02 17:53                 ` Jasmine Strong
2003-07-02 20:10                   ` Alex Samoutin
2003-07-04  1:43                   ` David Woodhouse
2003-07-03  5:44                 ` Stephan Linke
2003-07-05 15:15                   ` Thomas Gleixner
2003-07-07  9:27                     ` Stephan Linke
2003-07-07 13:48                       ` Thomas Gleixner
2003-07-08  7:50                         ` David Woodhouse
2003-04-26 10:18         ` Jörn Engel
2003-04-28  8:57           ` Thomas Gleixner
  -- strict thread matches above, loose matches on Subject: below --
2003-08-18 11:36 Eugeny Mints
2003-04-22  7:05 Paul Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox