public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* NAND + YAFFS2 - bad blocks
@ 2009-04-28 16:03 Stanislav Popov
  0 siblings, 0 replies; 6+ messages in thread
From: Stanislav Popov @ 2009-04-28 16:03 UTC (permalink / raw)
  To: linux-mtd

Hi,

I have 64 MB NAND flash on Jacinto (ARM) board.
I am using the device formatted as one YAFFS2 partition.
My SW ECC from NAND is enabled in the kernel and "useNANDECC" in YAFFS 
is set to 0
(If this is non-zero, then YAFFS will not perform ECC and it is assumed 
that the hardware ECC or specified NAND access functions will perform EC 
checks.)

I found that I have 1000-2000 eraseblocks that were reported as "bad block".
I can see them in u-boot with "nand bad" command and when laoding my 
nand_jacinto driver.
When using the NAND they are getting much more.
Actually they are NOT bad blocks!

I edited the kernel and remove is_bad checking when erasing.
Also I edited the mtd-utils (flash_eraseall) and removed is_bad checking 
when erasing.
So I was able to make low-level format of my NAND flash which also erase 
the bad blocks.
(like 'nand erase scrub' command in u-boot, but I currently I do not 
have such command)
After that I had NO bad blocks.

I made some tests:
I formatted Nand with YAFFS2 FS
-  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
getting more.
-  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks and 
getting more.

I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
-  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!

So the result is that the issue is in using YAFFS2 + NAND.

Maybe the source of the issue is some YAFFS2 configurations?
Do you have any idea?
It's very critical issue for me.

Thanks and Regards,
Stanislav

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

* Re: NAND + YAFFS2 - bad blocks
       [not found] <20090428145901.ED9188BC@resin13.mta.everyone.net>
@ 2009-04-29  7:03 ` Stanislav Popov
  2009-04-30  7:37   ` Stanislav Popov
  2009-05-04 20:00   ` Subramani
  2009-04-29 14:25 ` Stanislav Popov
  1 sibling, 2 replies; 6+ messages in thread
From: Stanislav Popov @ 2009-04-29  7:03 UTC (permalink / raw)
  To: subbu; +Cc: linux-mtd

Hi,

thanks for your reply!

If I use flash_eraseall then the bug could be in it ?
So there should be no issue in YAFFS2 FS or Kernel Driver?

How do you suggest to write the FS?

Thank you very much!
Stanislav

subbu@fortisys.com wrote:
> Hi,
> Yaffs2 is combination 2048+64 Bytes, when you write filesystem to NAND, you have to make sure that oob data is written to oob block from offset 0x2 to 0x34, if you write at oob data at offset 0x0 0x1, NAND will identify it as bad block, therefore you have to make sure to avoid writing oob from 0x0.
>
> Try using nandwrite utility with the above mention changes.
>
>
> Regards,
> Subramani V
> Massuchussets
> USA
>
>
> --- s.popov@rsc.bg wrote:
>
> From: Stanislav Popov <s.popov@rsc.bg>
> To: linux-mtd@lists.infradead.org
> Subject: NAND + YAFFS2 - bad blocks
> Date: Tue, 28 Apr 2009 19:03:26 +0300
>
> Hi,
>
> I have 64 MB NAND flash on Jacinto (ARM) board.
> I am using the device formatted as one YAFFS2 partition.
> My SW ECC from NAND is enabled in the kernel and "useNANDECC" in YAFFS 
> is set to 0
> (If this is non-zero, then YAFFS will not perform ECC and it is assumed 
> that the hardware ECC or specified NAND access functions will perform EC 
> checks.)
>
> I found that I have 1000-2000 eraseblocks that were reported as "bad block".
> I can see them in u-boot with "nand bad" command and when laoding my 
> nand_jacinto driver.
> When using the NAND they are getting much more.
> Actually they are NOT bad blocks!
>
> I edited the kernel and remove is_bad checking when erasing.
> Also I edited the mtd-utils (flash_eraseall) and removed is_bad checking 
> when erasing.
> So I was able to make low-level format of my NAND flash which also erase 
> the bad blocks.
> (like 'nand erase scrub' command in u-boot, but I currently I do not 
> have such command)
> After that I had NO bad blocks.
>
> I made some tests:
> I formatted Nand with YAFFS2 FS
> -  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
> getting more.
> -  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks and 
> getting more.
>
> I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
> -  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!
>
> So the result is that the issue is in using YAFFS2 + NAND.
>
> Maybe the source of the issue is some YAFFS2 configurations?
> Do you have any idea?
> It's very critical issue for me.
>
> Thanks and Regards,
> Stanislav
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>
>   

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

* Re: NAND + YAFFS2 - bad blocks
       [not found] <20090428145901.ED9188BC@resin13.mta.everyone.net>
  2009-04-29  7:03 ` NAND + YAFFS2 - bad blocks Stanislav Popov
@ 2009-04-29 14:25 ` Stanislav Popov
  2009-05-04 19:58   ` Subramani
  1 sibling, 1 reply; 6+ messages in thread
From: Stanislav Popov @ 2009-04-29 14:25 UTC (permalink / raw)
  To: subbu; +Cc: linux-mtd

The parameters of my chip are :512Mbit, 64Mx8, Page (512 + 16 OOB), 
block (16K + 512), Block erase time: 2ms, 

Actually I see that my FS is mounted as yaffs1 (not yaffs2).

subbu@fortisys.com wrote:
> Hi,
> Yaffs2 is combination 2048+64 Bytes, when you write filesystem to NAND, you have to make sure that oob data is written to oob block from offset 0x2 to 0x34, if you write at oob data at offset 0x0 0x1, NAND will identify it as bad block, therefore you have to make sure to avoid writing oob from 0x0.
>
> Try using nandwrite utility with the above mention changes.
>
>
> Regards,
> Subramani V
> Massuchussets
> USA
>
>
> --- s.popov@rsc.bg wrote:
>
> From: Stanislav Popov <s.popov@rsc.bg>
> To: linux-mtd@lists.infradead.org
> Subject: NAND + YAFFS2 - bad blocks
> Date: Tue, 28 Apr 2009 19:03:26 +0300
>
> Hi,
>
> I have 64 MB NAND flash on Jacinto (ARM) board.
> I am using the device formatted as one YAFFS2 partition.
> My SW ECC from NAND is enabled in the kernel and "useNANDECC" in YAFFS 
> is set to 0
> (If this is non-zero, then YAFFS will not perform ECC and it is assumed 
> that the hardware ECC or specified NAND access functions will perform EC 
> checks.)
>
> I found that I have 1000-2000 eraseblocks that were reported as "bad block".
> I can see them in u-boot with "nand bad" command and when laoding my 
> nand_jacinto driver.
> When using the NAND they are getting much more.
> Actually they are NOT bad blocks!
>
> I edited the kernel and remove is_bad checking when erasing.
> Also I edited the mtd-utils (flash_eraseall) and removed is_bad checking 
> when erasing.
> So I was able to make low-level format of my NAND flash which also erase 
> the bad blocks.
> (like 'nand erase scrub' command in u-boot, but I currently I do not 
> have such command)
> After that I had NO bad blocks.
>
> I made some tests:
> I formatted Nand with YAFFS2 FS
> -  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
> getting more.
> -  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks and 
> getting more.
>
> I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
> -  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!
>
> So the result is that the issue is in using YAFFS2 + NAND.
>
> Maybe the source of the issue is some YAFFS2 configurations?
> Do you have any idea?
> It's very critical issue for me.
>
> Thanks and Regards,
> Stanislav
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
>
>   

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

* Re: NAND + YAFFS2 - bad blocks
  2009-04-29  7:03 ` NAND + YAFFS2 - bad blocks Stanislav Popov
@ 2009-04-30  7:37   ` Stanislav Popov
  2009-05-04 20:00   ` Subramani
  1 sibling, 0 replies; 6+ messages in thread
From: Stanislav Popov @ 2009-04-30  7:37 UTC (permalink / raw)
  To: subbu; +Cc: linux-mtd

Hi,

Maybe I found the source of the issue.
I put some delays after evry chunk write in yaffs (my fs in yaffs) and 
it's working fine.
So the issue comes from timing configuration...
Where do you think could be the real source of the issue? - driver 
configuration? EMIF configuration? Hardware Issue?

Thanks and Regards,
Stanislav
>
>
> subbu@fortisys.com wrote:
>> Hi,
>> Yaffs2 is combination 2048+64 Bytes, when you write filesystem to 
>> NAND, you have to make sure that oob data is written to oob block 
>> from offset 0x2 to 0x34, if you write at oob data at offset 0x0 0x1, 
>> NAND will identify it as bad block, therefore you have to make sure 
>> to avoid writing oob from 0x0.
>>
>> Try using nandwrite utility with the above mention changes.
>>
>>
>> Regards,
>> Subramani V
>> Massuchussets
>> USA
>>
>>
>> --- s.popov@rsc.bg wrote:
>>
>> From: Stanislav Popov <s.popov@rsc.bg>
>> To: linux-mtd@lists.infradead.org
>> Subject: NAND + YAFFS2 - bad blocks
>> Date: Tue, 28 Apr 2009 19:03:26 +0300
>>
>> Hi,
>>
>> I have 64 MB NAND flash on Jacinto (ARM) board.
>> I am using the device formatted as one YAFFS2 partition.
>> My SW ECC from NAND is enabled in the kernel and "useNANDECC" in 
>> YAFFS is set to 0
>> (If this is non-zero, then YAFFS will not perform ECC and it is 
>> assumed that the hardware ECC or specified NAND access functions will 
>> perform EC checks.)
>>
>> I found that I have 1000-2000 eraseblocks that were reported as "bad 
>> block".
>> I can see them in u-boot with "nand bad" command and when laoding my 
>> nand_jacinto driver.
>> When using the NAND they are getting much more.
>> Actually they are NOT bad blocks!
>>
>> I edited the kernel and remove is_bad checking when erasing.
>> Also I edited the mtd-utils (flash_eraseall) and removed is_bad 
>> checking when erasing.
>> So I was able to make low-level format of my NAND flash which also 
>> erase the bad blocks.
>> (like 'nand erase scrub' command in u-boot, but I currently I do not 
>> have such command)
>> After that I had NO bad blocks.
>>
>> I made some tests:
>> I formatted Nand with YAFFS2 FS
>> -  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
>> getting more.
>> -  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks 
>> and getting more.
>>
>> I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
>> -  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!
>>
>> So the result is that the issue is in using YAFFS2 + NAND.
>>
>> Maybe the source of the issue is some YAFFS2 configurations?
>> Do you have any idea?
>> It's very critical issue for me.
>>
>> Thanks and Regards,
>> Stanislav
>>
>>
>>
>> ______________________________________________________
>> Linux MTD discussion mailing list
>> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>>
>>
>>   
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: NAND + YAFFS2 - bad blocks
  2009-04-29 14:25 ` Stanislav Popov
@ 2009-05-04 19:58   ` Subramani
  0 siblings, 0 replies; 6+ messages in thread
From: Subramani @ 2009-05-04 19:58 UTC (permalink / raw)
  To: Stanislav Popov; +Cc: linux-mtd

Since it is 512+16, also you are enabling ECC, I ask you to verify
whether ECC bytes are written at proper oob offset, this is one of the
issues we were facing on 2048+64 bytes.

-Subbu
On Wed, 2009-04-29 at 17:25 +0300, Stanislav Popov wrote:
> The parameters of my chip are :512Mbit, 64Mx8, Page (512 + 16 OOB), 
> block (16K + 512), Block erase time: 2ms, 
> 
> Actually I see that my FS is mounted as yaffs1 (not yaffs2).
> 
> subbu@fortisys.com wrote:
> > Hi,
> > Yaffs2 is combination 2048+64 Bytes, when you write filesystem to NAND, you have to make sure that oob data is written to oob block from offset 0x2 to 0x34, if you write at oob data at offset 0x0 0x1, NAND will identify it as bad block, therefore you have to make sure to avoid writing oob from 0x0.
> >
> > Try using nandwrite utility with the above mention changes.
> >
> >
> > Regards,
> > Subramani V
> > Massuchussets
> > USA
> >
> >
> > --- s.popov@rsc.bg wrote:
> >
> > From: Stanislav Popov <s.popov@rsc.bg>
> > To: linux-mtd@lists.infradead.org
> > Subject: NAND + YAFFS2 - bad blocks
> > Date: Tue, 28 Apr 2009 19:03:26 +0300
> >
> > Hi,
> >
> > I have 64 MB NAND flash on Jacinto (ARM) board.
> > I am using the device formatted as one YAFFS2 partition.
> > My SW ECC from NAND is enabled in the kernel and "useNANDECC" in YAFFS 
> > is set to 0
> > (If this is non-zero, then YAFFS will not perform ECC and it is assumed 
> > that the hardware ECC or specified NAND access functions will perform EC 
> > checks.)
> >
> > I found that I have 1000-2000 eraseblocks that were reported as "bad block".
> > I can see them in u-boot with "nand bad" command and when laoding my 
> > nand_jacinto driver.
> > When using the NAND they are getting much more.
> > Actually they are NOT bad blocks!
> >
> > I edited the kernel and remove is_bad checking when erasing.
> > Also I edited the mtd-utils (flash_eraseall) and removed is_bad checking 
> > when erasing.
> > So I was able to make low-level format of my NAND flash which also erase 
> > the bad blocks.
> > (like 'nand erase scrub' command in u-boot, but I currently I do not 
> > have such command)
> > After that I had NO bad blocks.
> >
> > I made some tests:
> > I formatted Nand with YAFFS2 FS
> > -  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
> > getting more.
> > -  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks and 
> > getting more.
> >
> > I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
> > -  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!
> >
> > So the result is that the issue is in using YAFFS2 + NAND.
> >
> > Maybe the source of the issue is some YAFFS2 configurations?
> > Do you have any idea?
> > It's very critical issue for me.
> >
> > Thanks and Regards,
> > Stanislav
> >
> >
> >
> > ______________________________________________________
> > Linux MTD discussion mailing list
> > http://lists.infradead.org/mailman/listinfo/linux-mtd/
> >
> >
> >   
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: NAND + YAFFS2 - bad blocks
  2009-04-29  7:03 ` NAND + YAFFS2 - bad blocks Stanislav Popov
  2009-04-30  7:37   ` Stanislav Popov
@ 2009-05-04 20:00   ` Subramani
  1 sibling, 0 replies; 6+ messages in thread
From: Subramani @ 2009-05-04 20:00 UTC (permalink / raw)
  To: Stanislav Popov; +Cc: linux-mtd

Flash_eraseall does not any problem, I belive it should be an issue with
nand_write or your NAND ECC module. These are the things you need to
verify at your end.

Regards,
Subbu
On Wed, 2009-04-29 at 10:03 +0300, Stanislav Popov wrote:
> Hi,
> 
> thanks for your reply!
> 
> If I use flash_eraseall then the bug could be in it ?
> So there should be no issue in YAFFS2 FS or Kernel Driver?
> 
> How do you suggest to write the FS?
> 
> Thank you very much!
> Stanislav
> 
> subbu@fortisys.com wrote:
> > Hi,
> > Yaffs2 is combination 2048+64 Bytes, when you write filesystem to NAND, you have to make sure that oob data is written to oob block from offset 0x2 to 0x34, if you write at oob data at offset 0x0 0x1, NAND will identify it as bad block, therefore you have to make sure to avoid writing oob from 0x0.
> >
> > Try using nandwrite utility with the above mention changes.
> >
> >
> > Regards,
> > Subramani V
> > Massuchussets
> > USA
> >
> >
> > --- s.popov@rsc.bg wrote:
> >
> > From: Stanislav Popov <s.popov@rsc.bg>
> > To: linux-mtd@lists.infradead.org
> > Subject: NAND + YAFFS2 - bad blocks
> > Date: Tue, 28 Apr 2009 19:03:26 +0300
> >
> > Hi,
> >
> > I have 64 MB NAND flash on Jacinto (ARM) board.
> > I am using the device formatted as one YAFFS2 partition.
> > My SW ECC from NAND is enabled in the kernel and "useNANDECC" in YAFFS 
> > is set to 0
> > (If this is non-zero, then YAFFS will not perform ECC and it is assumed 
> > that the hardware ECC or specified NAND access functions will perform EC 
> > checks.)
> >
> > I found that I have 1000-2000 eraseblocks that were reported as "bad block".
> > I can see them in u-boot with "nand bad" command and when laoding my 
> > nand_jacinto driver.
> > When using the NAND they are getting much more.
> > Actually they are NOT bad blocks!
> >
> > I edited the kernel and remove is_bad checking when erasing.
> > Also I edited the mtd-utils (flash_eraseall) and removed is_bad checking 
> > when erasing.
> > So I was able to make low-level format of my NAND flash which also erase 
> > the bad blocks.
> > (like 'nand erase scrub' command in u-boot, but I currently I do not 
> > have such command)
> > After that I had NO bad blocks.
> >
> > I made some tests:
> > I formatted Nand with YAFFS2 FS
> > -  YAFFS2 ECC + NO NAND ECC - when using fs appeared bad blocks and 
> > getting more.
> > -  YAFFS2 NO ECC + NAND SW ECC - when using fs appeared bad blocks and 
> > getting more.
> >
> > I formatted Nand with EXT2 FS (ext2 fs is not writing into oob)
> > -  NAND SW ECC ENABLE - NO bad blocks appeared in the time!!!
> >
> > So the result is that the issue is in using YAFFS2 + NAND.
> >
> > Maybe the source of the issue is some YAFFS2 configurations?
> > Do you have any idea?
> > It's very critical issue for me.
> >
> > Thanks and Regards,
> > Stanislav
> >
> >
> >
> > ______________________________________________________
> > Linux MTD discussion mailing list
> > http://lists.infradead.org/mailman/listinfo/linux-mtd/
> >
> >
> >   
> 

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

end of thread, other threads:[~2009-05-04 20:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090428145901.ED9188BC@resin13.mta.everyone.net>
2009-04-29  7:03 ` NAND + YAFFS2 - bad blocks Stanislav Popov
2009-04-30  7:37   ` Stanislav Popov
2009-05-04 20:00   ` Subramani
2009-04-29 14:25 ` Stanislav Popov
2009-05-04 19:58   ` Subramani
2009-04-28 16:03 Stanislav Popov

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