Thomas Gleixner wrote: > On Thu, 2004-12-02 at 16:19 +1100, Aras Vaichas wrote: > >>Hello all, >> >>I have managed to get the latest MTD code to compile with a 2.4.27-vrs1 kernel. >>I compiled the latest YAFFS code (from CVS) into the kernel. I mounted a 16MB >>block of Smartmedia NAND and tried to create some files, I got a load of errors >>, I reset the machine because it was obviously going crazy. I then noticed that >>my NAND suddenly had a load of "bad blocks" > > Obviously some errors resulted in marking the blocks bad. > > Can you first verify that your driver works correctly without a > filesystem ? Use nandwrite to write a file to the chip and nanddump to > read it back. hmm, it *sort* of works, but it looks like there is corruption. nandtest # echo "Hello World! ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" > text.orig && nandwrite -a -p /dev/mtd/4 text.orig MTD_open MTD_ioctl MTD_ioctl WriMTD_ioctl tinand_isbad_bbt(): bbt info for offs 0x00000000: (block 0) 0x00 ng data to block 0 MTD_write nand_write_ecc: to = 0x00000000, len = 512 MTD_close nand_sync: called nandtest # nanddump /dev/mtd/4 text.out 0 512 && cat text.out MTD_open MTD_ioctl Would you like formatted output? n DumMTD_read pnand_read_ecc: from = 0x00000000, len = 512 ing nand_read_ecc: Failed ECC read, page 0x00000000 data starting at 0x00000000 and ending at 0x00000200.MTD_ioctl ..nand_read_oob: from = 0x00000000, len = 16 Dumping 0 MTD_close nand_sync: called Hello World AC@A@@@@ LMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿaA.ÿÿÿÿÿaa.ÿÿÿÿÿ nandtest # nandtest # mtd_debug info /dev/mtd/4 MTD_open MTD_ioctl MTD_ioctl mtd.type =MTD_close nand_sync: called MTD_NANDFLASH mtd.flags = MTD_CLEAR_BITS | MTD_ERASEABLE | MTD_OOB | MTD_ECC mtd.size = 16777216 (16M) mtd.erasesize = 16384 (16K) mtd.oobblock = 512 mtd.oobsize = 16 mtd.ecctype = MTD_ECC_NONE regions = 0