public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* samsung nand jffs2 errors
@ 2007-01-17 14:42 eugene.kozlov
  2007-01-18 11:15 ` eugene.kozlov
  0 siblings, 1 reply; 3+ messages in thread
From: eugene.kozlov @ 2007-01-17 14:42 UTC (permalink / raw)
  To: linux-mtd

Hello
I have good working samsung 64MB k9f1208uob nand flash on 2.6.16 kernel
with at91rm9200 patch and our board specific patches:
md5sum on images writed to /dev/mtdblock/1 is ok.

But when i use jffs2 its returned errors and wrong md5sum on images writed
to jffs2.
To prepare jffs2 image i use: mkfs.jffs2 -o jffs2_image -s 512 -e 16384 -d
jffs2_dir -p 0x4000 -n
I erase flash with "flash_eraseall /dev/mtd/1" from mtd utils and copy
image to flash by nandwrite.
When mount - get such: (this happens on free space, nanddump below)

1)
jffs2_scan_eraseblock(): Node at 0x00178008 {0x1985, 0x2003, 0x00000008)
has invalid CRC 0x00000000 (calculated 0x6b7c27e6)
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017800c:
0x0008 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00178018:
0xff7f instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017801c:
0xffff instead
JFFS2: Erase block at 0x00178000 is not formatted. It will be erased

and sometimes
2)
mtd->read(0x400 bytes from 0x16d0000) returned ECC error
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0000:
0x03f3 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0004:
0xffff instead
Empty flash at 0x016d0008 ends at 0x016d0038
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0038:
0xffff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d003c:
0x0ca7 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0040:
0xf3f0 instead
Empty flash at 0x016d0044 ends at 0x016d0070
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0070:
0xffff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0074:
0x3f0c instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0078:
0x65ff instead
Empty flash at 0x016d007c ends at 0x016d00ac
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d00ac:
0xaaff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d00b0:
0xff0f instead
Further such events for this erase block will not be printed
Empty flash at 0x016d00b8 ends at 0x016d00e4
Empty flash at 0x016d00f0 ends at 0x016d0120
Empty flash at 0x016d012c ends at 0x016d0158
Empty flash at 0x016d0164 ends at 0x016d0194
Empty flash at 0x016d01a0 ends at 0x016d01cc
Empty flash at 0x016d01d8 ends at 0x016d0200


This usual nanddump:
/mnt/dataflash/nanddump -l 1 -p /dev/mtd/1 -s 0x3f18000
No ECC status information available: Inappropriate ioctl for device
Block size 16384, page size 512, OOB size 16
Dumping data starting at 0x03f18000 and ending at 0x03f18001...
0x03f18000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f180f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18110: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18120: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18130: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18140: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18150: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18160: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18170: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f18190: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0x03f181f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
  OOB Data: ff ff ff ff ff ff ff ff 85 19 03 20 08 00 00 00

Thanks for advice

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

* Re: samsung nand jffs2 errors
  2007-01-17 14:42 eugene.kozlov
@ 2007-01-18 11:15 ` eugene.kozlov
  0 siblings, 0 replies; 3+ messages in thread
From: eugene.kozlov @ 2007-01-18 11:15 UTC (permalink / raw)
  To: linux-mtd


The problem has been solved by adding a delay after
jffs2_check_nand_cleanmarker(c, jeb); in function jffs2_scan_eraseblock()
Can somebody explain this???
It also makes mounting partition alittle slower.

I use Samsung nand flash
http://samsung.com/products/semiconductor/NANDFlash/SLC_SmallBlock/512Mbit/K9F1208U0B/K9F1208U0B.htm
and apply harware specific value:
        nand_chip->chip_delay = 20; //encreasing this hasn't affect

ps: i use right parameters of page and eraseblock sizes: 512 and 16384 Bytes

--- scan.c      2007-01-08 13:41:45.000000000 +0000
+++ scan.c.mod  2007-01-18 12:42:26.000000000 +0000
@@ -330,6 +330,9 @@
        if (jffs2_cleanmarker_oob(c)) {
                int ret = jffs2_check_nand_cleanmarker(c, jeb);
                D2(printk(KERN_NOTICE "jffs_check_nand_cleanmarker
returned %d\n",ret));
+//lieugene
+#include <linux/delay.h>;
+               msleep(1);
                /* Even if it's not found, we still scan to see
                   if the block is empty. We use this information
                   to decide whether to erase it or not. */

> Hello
> I have good working samsung 64MB k9f1208uob nand flash on 2.6.16 kernel
> with at91rm9200 patch and our board specific patches:
> md5sum on images writed to /dev/mtdblock/1 is ok.
>
> But when i use jffs2 its returned errors and wrong md5sum on images writed
> to jffs2.
> To prepare jffs2 image i use: mkfs.jffs2 -o jffs2_image -s 512 -e 16384 -d
> jffs2_dir -p 0x4000 -n
> I erase flash with "flash_eraseall /dev/mtd/1" from mtd utils and copy
> image to flash by nandwrite.
> When mount - get such: (this happens on free space, nanddump below)
>
> 1)
> jffs2_scan_eraseblock(): Node at 0x00178008 {0x1985, 0x2003, 0x00000008)
> has invalid CRC 0x00000000 (calculated 0x6b7c27e6)
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017800c:
> 0x0008 instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00178018:
> 0xff7f instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0017801c:
> 0xffff instead
> JFFS2: Erase block at 0x00178000 is not formatted. It will be erased
>
> and sometimes
> 2)
> mtd->read(0x400 bytes from 0x16d0000) returned ECC error
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0000:
> 0x03f3 instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0004:
> 0xffff instead
> Empty flash at 0x016d0008 ends at 0x016d0038
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0038:
> 0xffff instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d003c:
> 0x0ca7 instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0040:
> 0xf3f0 instead
> Empty flash at 0x016d0044 ends at 0x016d0070
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0070:
> 0xffff instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0074:
> 0x3f0c instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d0078:
> 0x65ff instead
> Empty flash at 0x016d007c ends at 0x016d00ac
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d00ac:
> 0xaaff instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x016d00b0:
> 0xff0f instead
> Further such events for this erase block will not be printed
> Empty flash at 0x016d00b8 ends at 0x016d00e4
> Empty flash at 0x016d00f0 ends at 0x016d0120
> Empty flash at 0x016d012c ends at 0x016d0158
> Empty flash at 0x016d0164 ends at 0x016d0194
> Empty flash at 0x016d01a0 ends at 0x016d01cc
> Empty flash at 0x016d01d8 ends at 0x016d0200
>
>
> This usual nanddump:
> /mnt/dataflash/nanddump -l 1 -p /dev/mtd/1 -s 0x3f18000
> No ECC status information available: Inappropriate ioctl for device
> Block size 16384, page size 512, OOB size 16
> Dumping data starting at 0x03f18000 and ending at 0x03f18001...
> 0x03f18000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18060: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f180f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18110: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18120: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18130: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18140: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18150: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18160: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18170: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f18190: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> 0x03f181f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>   OOB Data: ff ff ff ff ff ff ff ff 85 19 03 20 08 00 00 00
>
> Thanks for advice
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>

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

* Re: samsung nand jffs2 errors
       [not found] <200701190824404064520@163.com>
@ 2007-01-19 14:39 ` eugene.kozlov
  0 siblings, 0 replies; 3+ messages in thread
From: eugene.kozlov @ 2007-01-19 14:39 UTC (permalink / raw)
  To: howhowwork; +Cc: linux-mtd

Hi howhowwork

Yes i use flash_eraseall -j /dev/mtd/1 as you can see it in nanddump i
just forgot to write it in message

For me its not a clear to understand what is happening because when i
increase chip_delay - it not solve the problem but using delay between
jffs2_check_nand_cleanmarker solve this.

I have some question:
In nand.h:
 * @dev_ready:          [BOARDSPECIFIC] hardwarespecific function for
accesing device ready/busy line
 *                      If set to NULL no access to ready/busy is
available and the ready/busy information
 *                      is read from the chip status register

But i see only using chip_delay when ready/busy pin not available:
                if (!this->dev_ready) {
                        udelay (this->chip_delay);
                        return;
                }
So i need to realise in hardwarespicific function @dev_ready read from the
chip status register or this should be done in nand_base.c?????
Because if first it's need to implement read things from nand_base.c in
hardwarespecific function and this not good practice!!!!

thanx

> Hi  eugene
> To prepare jffs2 image i use: mkfs.jffs2 -o jffs2_image -s 512 -e 16384 -d
>> jffs2_dir -p 0x4000 -n
>> I erase flash with "flash_eraseall /dev/mtd/1" from mtd utils and copy
>> image to flash by nandwrite.
>
> "flash_eraseall /dev/mtd/1 " you maybe use "flash_eraseall -j  /dev/mtd/1"
> when jffs2 scan eraseblock ,it do not need to write the message "OOB Data:
> ff ff ff ff ff ff ff ff 85 19 03 20 08 00 00 00"
>
>
>
>
> howhowwork
> 2007-01-19
>

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

end of thread, other threads:[~2007-01-19 14:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200701190824404064520@163.com>
2007-01-19 14:39 ` samsung nand jffs2 errors eugene.kozlov
2007-01-17 14:42 eugene.kozlov
2007-01-18 11:15 ` eugene.kozlov

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