From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.nokia.com ([192.100.105.134] helo=mgw-mx09.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1NUyGM-0008Hk-FM for linux-mtd@lists.infradead.org; Wed, 13 Jan 2010 08:07:39 +0000 Subject: Re: Fail to mount ubifs From: Artem Bityutskiy To: Jon Ringle In-Reply-To: <1263369336.2917.6.camel@localhost> References: <152584231001111056n2d174f8fmef6641c4fee99781@mail.gmail.com> <152584231001111620i6b397f43n49733caa8f92f472@mail.gmail.com> <1263271808.30988.38.camel@localhost.localdomain> <152584231001121223q123b5b2flbdd9fcde370c3105@mail.gmail.com> <1263331836.3445.4.camel@localhost.localdomain> <152584231001121615h2b52b7ddv33980c9c4a88f37b@mail.gmail.com> <152584231001122303g66f776bdo57f6f08307f77dd0@mail.gmail.com> <1263369336.2917.6.camel@localhost> Content-Type: text/plain; charset="UTF-8" Date: Wed, 13 Jan 2010 10:06:52 +0200 Message-Id: <1263370012.2917.9.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: linux-mtd@lists.infradead.org, Deepak Saxena Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2010-01-13 at 09:55 +0200, Artem Bityutskiy wrote: > On Wed, 2010-01-13 at 02:03 -0500, Jon Ringle wrote: > > I believe that there is an alignment problem due to the read function > > mapped to ixp4xx_read16. > > > > I enabled the following: > > CONFIG_MTD_UBI_DEBUG=y > > CONFIG_MTD_UBI_DEBUG_MSG=y > > CONFIG_MTD_UBI_DEBUG_MSG_EBA=y > > > > (initramfs) mount -t ubifs ubi0:ubifs /mnt0 > > [ 1693.480000] UBI DBG (pid 2323): ubi_open_volume_path: open volume > > ubi0:ubifs, mode 1 > > [ 1693.490000] UBI DBG (pid 2323): ubi_open_volume_nm: open device 0, > > volume ubifs, mode 1 > > [ 1693.490000] UBI DBG (pid 2323): ubi_open_volume: open device 0, > > volume 2, mode 1 > > [ 1693.500000] UBI DBG (pid 2323): ubi_open_volume: open device 0, > > volume 2, mode 2 > > [ 1693.510000] UBI DBG (pid 2323): ubi_is_mapped: test LEB 2:0 > > > > [ 1694.130000] UBI DBG (pid 2323): ubi_is_mapped: test LEB 2:109 > > [ 1694.140000] UBI DBG (pid 2323): ubi_leb_change: atomically write > > 560 bytes to LEB 2:6 > > [ 1694.150000] UBI DBG (pid 2323): ubi_eba_atomic_leb_change: change > > LEB 2:6, PEB -1, write VID hdr to PEB 5 > > 11 bytes starting at LEB 2:6:545 has the following data: > > 0xb7 0xe2 0x02 0xd5 0x9f 0x00 0x00 0xe0 0x7f 0x00 0x00 > > > > > > [ 1694.520000] UBI DBG (pid 2323): ubi_leb_read: read 11 bytes from LEB 2:6:545 > > [ 1694.530000] UBI DBG (pid 2323): ubi_eba_read_leb: read 11 bytes > > from offset 545 of LEB 2:6, PEB 5 > > [ 1694.540000] UBIFS error (pid 2323): check_lpt_crc: invalid crc in > > LPT node: crc e2e2 calc e2b7 > > 11 bytes starting at LEB 2:6:545 has the following data: > > 0xe2 0xe2 0x02 0xd5 0x9f 0x00 0x00 0xe0 0x7f 0x00 0x00 > > > > [ 1694.550000] [] (unwind_backtrace+0x0/0x160) from > > [] (check_lpt_crc+0x9c/0xb0 [ubifs]) > > [ 1694.560000] [] (check_lpt_crc+0x9c/0xb0 [ubifs]) from > > [] (unpack_ltab+0x114/0x118 [ubifs]) > > [ 1694.570000] [] (unpack_ltab+0x114/0x118 [ubifs]) from > > [] (lpt_init_rd+0x110/0x6f8 [ubifs]) > > [ 1694.580000] [] (lpt_init_rd+0x110/0x6f8 [ubifs]) from > > [] (ubifs_lpt_init+0x30/0x54 [ubifs]) > > [ 1694.590000] [] (ubifs_lpt_init+0x30/0x54 [ubifs]) from > > [] (mount_ubifs+0x368/0x1620 [ubifs]) > > [ 1694.600000] [] (mount_ubifs+0x368/0x1620 [ubifs]) from > > [] (ubifs_fill_super+0x318/0x42c [ubifs]) > > [ 1694.610000] [] (ubifs_fill_super+0x318/0x42c [ubifs]) > > from [] (ubifs_get_sb+0xd8/0x22c [ubifs]) > > [ 1694.620000] [] (ubifs_get_sb+0xd8/0x22c [ubifs]) from > > [] (vfs_kern_mount+0x68/0x12c) > > [ 1694.630000] [] (vfs_kern_mount+0x68/0x12c) from > > [] (do_kern_mount+0x34/0xdc) > > [ 1694.640000] [] (do_kern_mount+0x34/0xdc) from > > [] (do_mount+0x210/0x244) > > [ 1694.650000] [] (do_mount+0x210/0x244) from [] > > (sys_mount+0x9c/0xd0) > > [ 1694.660000] [] (sys_mount+0x9c/0xd0) from [] > > (ret_fast_syscall+0x0/0x2c) > > > > Looking into drivers/mtd/maps/ixp4xx.c I see that the read function is > > ixp4xx_read16(). It seems to me that there is an alignment problem. > > The read starts at offset 545 which in unaligned with a 16-bit read > > that is done by ixp4xx_read16(). > > Yeah, most probably. Too bad we do not have a test for this. Care to > extend MTD tests? I mean, add an 'mtd_align', and verify reading from various unaligned addresses. This will help you to verify your flash, and help the community as well. -- Best Regards, Artem Bityutskiy (Артём Битюцкий)