public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* UBI use subpage and verify fail when write on nandflash
@ 2012-04-17 14:19 b w
  2012-04-18  4:27 ` Brian Norris
  2012-04-26  5:47 ` Artem Bityutskiy
  0 siblings, 2 replies; 5+ messages in thread
From: b w @ 2012-04-17 14:19 UTC (permalink / raw)
  To: linux-mtd

Hello,
    Use linux 2.6.32,ARM,nandflash(support subpage),config
CONFIG_MTD_NAND_VERIFY_WRITE. UBI attach fail on empty flash.I found
when UBI write VID header to the second subpage of eraseblock,will
call function "nand_write_page",this function write a whole page(i
think the page size is 2048),the unset bit of the buf is filled with
0xff,after write,

#ifdef CONFIG_MTD_NAND_VERIFY_WRITE
	/* Send command to read back the data */
	chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);

	if (chip->verify_buf(mtd, buf, mtd->writesize))
		return -EIO;
#endif

now,the buf for verify is not equal to the buf which write,because the
buf which read from flash contains EC header ?

I found there is topic also mention subpage:
http://lists.infradead.org/pipermail/linux-mtd/2010-September/031822.html

error log:
UBI: attaching mtd3 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: empty MTD device detected
UBI: create volume table (copy #1)
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
0:512, written 0 bytes
Backtrace:
[<c0212a24>] (dump_stack+0x18/0x1c)
[<c040aab8>] (ubi_io_write+0x324/0x3a8)
[<c038e118>] (ubi_io_write_vid_hdr+0x134/0x150)
[<c038e4c0>] (create_vtbl+0x1bc/0x290)
[<c0383734>] (ubi_read_volume_table+0xe8/0x984)
[<c0384070>] (ubi_attach_mtd_dev+0x690/0xd24)
[<c03873c0>] (ctrl_cdev_ioctl+0xe8/0x1a4)
[<c03883a0>] (vfs_ioctl+0x38/0x78)

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

end of thread, other threads:[~2012-04-26  5:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 14:19 UBI use subpage and verify fail when write on nandflash b w
2012-04-18  4:27 ` Brian Norris
2012-04-18  5:05   ` Jon Povey
2012-04-26  5:52     ` Artem Bityutskiy
2012-04-26  5:47 ` Artem Bityutskiy

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