Am 2013-09-24 19:09, schrieb Gabor Juhos:
>> A dd command with conv=noerror leads to a image witch is 16KiB smaller
>> than it should be.
> 
> Don't use dd on NAND flashes. Use the nanddump utility from the mtd-utils
> package instead.

Ok I understand that /dev/mtdblock[x] is not the way to handle NAND, but
reading should work anyway. By using nanddump I could successfully dump
the images, although the ECC check corrected bitflips. I guess that when
using this NAND through mtdblock, this leads to an I/O error (since its
the exactly same place, 2880*512 = 0x00168000).

root@OpenWrt:/tmp# dd if=/dev/mtdblock10 of=/tmp/gaga
[ 1350.920000] end_request: I/O error, dev mtdblock10, sector 2880
[ 1350.920000] Buffer I/O error on device mtdblock10, logical block 360
[ 1351.000000] end_request: I/O error, dev mtdblock10, sector 2880
[ 1351.000000] Buffer I/O error on device mtdblock10, logical block 360
dd: /dev/mtdblock10: Input/output error
root@OpenWrt:/tmp# nanddump /dev/mtd10 >/tmp/wndr4300-mtd10-nanddump.img
--omito
ob --bb=skipbad
ECC failed: 0
ECC corrected: 48
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x01900000...
ECC: 16 corrected bitflip(s) at offset 0x00168000

But this is not a showstopper than, since the driver seems to work
correctly using the mtd interface.

 
> Did you write/erase the any of the partitions by any chance?
Hm, I think I played around mounting the jffs2 partition once.. this
should be after the CRC checked squashfs, but maybe I used the wrong
mtd. This would explain the error. I reflashed the image, since then it
boots fine even after using nanddump etc. from initram 


Now I tried to create a UBI volume using the initramfs-Kernel. I get
this kernel crash dump:

# ubiattach -m 8 /dev/ubi_ctrl
[ 3712.320000] UBI: attaching mtd8 to ubi0
[ 3712.510000] UBI: scanning is finished
[ 3712.520000] UBI: empty MTD device detected
[ 3712.520000] CPU 0 Unable to handle kernel paging request at virtual
address 00000000, epc == 00000000, ra == 802094fc
[ 3712.530000] Oops[#1]:
[ 3712.530000] CPU: 0 PID: 1216 Comm: ubiattach Not tainted 3.10.12 #10
[ 3712.530000] task: 878b5d50 ti: 8654c000 task.ti: 8654c000
[ 3712.530000] $ 0   : 00000000 00000001 00000000 8037c810
[ 3712.530000] $ 4   : 87826010 00000001 000001ff 00000200
[ 3712.530000] $ 8   : 00000005 80064830 00000000 00000000
[ 3712.530000] $12   : 00000000 d8197822 00000000 00000000
[ 3712.530000] $16   : 878261b8 00000000 87826010 86e34000
[ 3712.530000] $20   : 00000200 86e34500 86e34d00 00000007
[ 3712.530000] $24   : 00000000 00000000
[ 3712.530000] $28   : 8654c000 8654dae8 00000000 802094fc
[ 3712.530000] Hi    : 00000000
[ 3712.530000] Lo    : 00000010
[ 3712.530000] epc   : 00000000   (null)
[ 3712.530000]     Not tainted
[ 3712.530000] ra    : 802094fc nand_write_subpage_hwecc+0xa0/0x1c4
[ 3712.530000] Status: 1100dc03 KERNEL EXL IE
[ 3712.530000] Cause : 00800008
[ 3712.530000] BadVA : 00000000
[ 3712.530000] PrId  : 0001974c (MIPS 74Kc)
[ 3712.530000] Modules linked in: ath9k ath9k_common pppoe ppp_async
iptable_nat ath9k_hw ath pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4
mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_state xt_nat
xt_multiport xt_mark xt_mac xt_limit xt_conntrack xt_comment xt_TCPMSS
xt_REDIRECT xt_LOG xt_CT slhc nf_nat_irc nf_nat_ftp nf_nat
nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw
iptable_mangle iptable_filter ipt_REJECT ip_tables crc_ccitt compat
ledtrig_usbdev ledtrig_netdev ip6t_REJECT ip6t_rt ip6t_hbh ip6t_mh
ip6t_ipv6header ip6t_frag ip6t_eui64 ip6t_ah ip6table_raw
ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6
nf_conntrack nf_defrag_ipv6 ipv6 arc4 crypto_blkcipher usb_storage
leds_gpio ohci_hcd ledtrig_timer ledtrig_default_on ehci_platform
ehci_hcd sd_mod scsi_mod gpio_button_hotplug ext4 jbd2 mbcache usbcore
nls_base usb_common crc32c crypto_hash
[ 3712.530000] Process ubiattach (pid: 1216, threadinfo=8654c000,
task=878b5d50, tls=77b24440)
[ 3712.530000] Stack : 00001040 00000000 00000000 80099d00 00000004
00000000 00000010 8037c810
          878261b8 87826010 00000000 00000200 86e34500 00000000 00000001
00000fc0
          00000fc0 802093ac 878261b8 80208f98 00000000 878261b8 86e34500
00000000
          878261b8 878261b8 8654dc00 87826010 00000200 00000000 00000200
00000fc0
          00000000 80209d18 8794e600 8654dc08 00000000 00000000 86e34500
00000000
          ...
[ 3712.530000] Call Trace:
[ 3712.530000] [<80099d00>] __wake_up+0x24/0x44
[ 3712.530000] [<802093ac>] nand_write_page+0xc0/0x170
[ 3712.530000] [<80208f98>] nand_release_device+0x30/0x3c
[ 3712.530000] [<80209d18>] nand_do_write_ops+0x308/0x3c4
[ 3712.530000] [<801fb0d0>] part_erase+0x22c/0x2c8
[ 3712.530000] [<80209f28>] nand_write+0x5c/0x94
[ 3712.530000] [<8021ae34>] ubi_io_write+0x350/0x618
[ 3712.530000] [<8020048c>] erase_callback+0x0/0x14
[ 3712.530000] [<8021b2ec>] ubi_io_write_ec_hdr+0xf0/0x108
[ 3712.530000] [<8021e3f8>] ubi_early_get_peb+0x12c/0x1e0
[ 3712.530000] [<802110b4>] ubi_read_volume_table+0xbc/0x99c
[ 3712.530000] [<80210874>] create_vtbl+0x7c/0x1d0
[ 3712.530000] [<802110b4>] ubi_read_volume_table+0xbc/0x99c
[ 3712.530000] [<80211104>] ubi_read_volume_table+0x10c/0x99c
[ 3712.530000] [<8021f6f0>] ubi_attach+0x1244/0x1320
[ 3712.530000] [<801e50bc>] serial8250_console_putchar+0x0/0x44
[ 3712.530000] [<800dae04>] __vmalloc_node+0x30/0x3c
[ 3712.530000] [<80214f94>] ubi_attach_mtd_dev+0xc30/0xc48
[ 3712.530000] [<802149d4>] ubi_attach_mtd_dev+0x670/0xc48
[ 3712.530000] [<80215208>] ctrl_cdev_ioctl+0xd0/0x184
[ 3712.530000] [<80186f40>] do_shmat+0x18/0x334
[ 3712.530000] [<800f403c>] do_vfs_ioctl+0x598/0x5ec
[ 3712.530000] [<800fc530>] __alloc_fd+0x80/0x170
[ 3712.530000] [<80186f40>] do_shmat+0x18/0x334
[ 3712.530000] [<800f40e8>] SyS_ioctl+0x58/0x90
[ 3712.530000] [<80186f40>] do_shmat+0x18/0x334
[ 3712.530000] [<80062544>] stack_done+0x20/0x40
[ 3712.530000] [<80186f40>] do_shmat+0x18/0x334
[ 3712.530000]
[ 3712.530000]
Code: (Bad address in epc)
[ 3712.530000]
[ 3712.890000] ---[ end trace b19ec24b4cf2d6ab ]---
Segmentation fault


This error is reproducible on my device.


-
Stefan
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to