Linux使用Ubi文件系统,内核报错ubi_io_read:error -74

内核报错如下:

Linux version 4.9.138 (root@ubuntu) (gcc version 4.9.4 (molchipv500-armgcc-uclibc-190826) ) #1 SMP Wed Jan 11 23:12:37 PST 2023
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: div instructions available: patching division code
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: FY10P
earlycon: mol_serial0 at MMIO 0x18400000 (options '')
bootconsole [mol_serial0] enabled
Memory policy: Data cache writealloc
percpu: Embedded 13 pages/cpu @eb657000 s23948 r8192 d21108 u53248
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 177800
Kernel command line: mem=700M earlycon console=ttyS0,115200 init=/init ubi.mtd=2 root=ubi0:rootfs rootwait rootfstype=ubifs rw mtdparts=spi_nfc:1M(uboot),8M(zImage),240M(rootfs),256K(logo)
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 702596K/716800K available (4694K kernel code, 169K rwdata, 1140K rodata, 1024K init, 248K bss, 14204K reserved, 0K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xec000000 - 0xff800000   ( 312 MB)
    lowmem  : 0xc0000000 - 0xebc00000   ( 700 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc0595a24   (5687 kB)
      .init : 0xc0700000 - 0xc0800000   (1024 kB)
      .data : 0xc0800000 - 0xc082a440   ( 170 kB)
       .bss : 0xc082a440 - 0xc08687d4   ( 249 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
NR_IRQS:16 nr_irqs:128 128
arm_arch_timer: Architected cp15 timer(s) running at 1500.00MHz (phys).
clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x159f22938a9, max_idle_ns: 440795218881 ns
sched_clock: 56 bits at 1500MHz, resolution 0ns, wraps every 4398046511103ns
Switching to timer-based delay loop, resolution 0ns
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 3000.00 BogoMIPS (lpj=15000000)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
/cpus/cpu@0 missing clock-frequency property
/cpus/cpu@1 missing clock-frequency property
CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
Setting up static identity map for 0x40100000 - 0x40100058
CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
Brought up 2 CPUs
SMP: Total of 2 processors activated (6000.00 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
futex hash table entries: 512 (order: 3, 32768 bytes)
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
dma64 10200000.dma64: Molchip DMA Controller,32 channels
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
mc,efuse 1ba00000.efuse: NVMEM EFUSE
mc,efuse 1bb00000.efuse: NVMEM EFUSE
clocksource: Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
workingset: timestamp_bits=30 max_order=18 bucket_order=0
squashfs: version 4.0 (2009/01/31) Phillip Lougher
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma ioctl init
18400000.uart: ttyS0 at MMIO 0x18400000 (irq = 132, base_baud = 1500000) is a SPX
console [ttyS0] enabled
console [ttyS0] enabled
bootconsole [mol_serial0] disabled
bootconsole [mol_serial0] disabled
18300000.uart: ttyS1 at MMIO 0x18300000 (irq = 133, base_baud = 1500000) is a SPX
18200000.uart: ttyS2 at MMIO 0x18200000 (irq = 134, base_baud = 1500000) is a SPX
18600000.uart: ttyS3 at MMIO 0x18600000 (irq = 135, base_baud = 1500000) is a SPX
ahci 20000000.sata0: forcing port_map 0x0 -> 0x1
ahci 20000000.sata0: SSS flag set, parallel bus scan disabled
ahci 20000000.sata0: AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl platform mode
ahci 20000000.sata0: flags: ncq sntf stag pm led clo only pmp fbs pio slum part ccc apst
ahci 20000000.sata0: port 0 can do FBS, forcing FBSCP
scsi host0: ahci
ata1: SATA max UDMA/133 mmio [mem 0x20000000-0x20000fff] port 0x100 irq 152
ahci 20400000.sata1: forcing port_map 0x0 -> 0x1
ahci 20400000.sata1: SSS flag set, parallel bus scan disabled
ahci 20400000.sata1: AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl platform mode
ahci 20400000.sata1: flags: ncq sntf stag pm led clo only pmp fbs pio slum part ccc apst
ahci 20400000.sata1: port 0 can do FBS, forcing FBSCP
scsi host1: ahci
ata2: SATA max UDMA/133 mmio [mem 0x20400000-0x20400fff] port 0x100 irq 153
*kernel_test* -- [drivers/mtd/nand/nand_base.c, find_full_id_nand, 4065], curr NAND name: [GTS2G3M1S-WS 3.3V SPI] only have 2 byte ID: [0x2c, 0x24], reset 3rd byte to 0.
*kernel_test* -- [drivers/mtd/nand/nand_base.c, find_full_id_nand, 4070], id_data[2]: [0x00].
nand: device found, Manufacturer ID: 0x2c, Chip ID: 0x24
nand: Micron GTS2G3M1S-WS 3.3V SPI
nand: 256 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 128
*kernel_test* -- [drivers/mtd/nand/mc_spi_nfc.c, spi_nand_ecc_disable, 702], NAND options: [0x10641].
*kernel_test* -- [drivers/mtd/nand/mc_spi_nfc.c, spi_nand_ecc_disable, 705], write 0x1 to B0h.
4 cmdlinepart partitions found on MTD device spi_nfc
Creating 4 MTD partitions on "spi_nfc":
0x000000000000-0x000000100000 : "uboot"
0x000000100000-0x000000900000 : "zImage"
0x000000900000-0x00000f900000 : "rootfs"
ata2: link offline retry
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata1.00: ATA-10: ST4000VX016-3CV104, CV10, max UDMA/133
ata1.00: 7814037168 sectors, multi 16: LBA48 NCQ (depth 31/32)
ata1.00: configured for UDMA/133
scsi 0:0:0:0: Direct-Access     ATA      ST4000VX016-3CV1 CV10 PQ: 0 ANSI: 5
0x00000f900000-0x00000f940000 : "logo"
libphy: Fixed MDIO Bus: probed
ata2: link offline retry
sd 0:0:0:0: Attached scsi generic sg0 type 0
sd 0:0:0:0: [sda] 7814037168 512-byte logical blocks: (4.00 TB/3.64 TiB)
sd 0:0:0:0: [sda] 4096-byte physical blocks
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 0:0:0:0: [sda] Attached SCSI disk
dwceqos 1b800000.ethernet: mdio set csr rate (100000000)
libphy: DWCEQOS MII bus: probed
dwceqos 1b800000.ethernet (unnamed net_device) (uninitialized): no PHY found
dwceqos 1b800000.ethernet (unnamed net_device) (uninitialized): mii_probe fail.
ata2: link offline retry
dwceqos 1b900000.ethernet: mdio set csr rate (100000000)
libphy: DWCEQOS MII bus: probed
Generic PHY 1b900000:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1b900000:01, irq=-1)
dwceqos 1b900000.ethernet: pdev->id -1, baseaddr 0x1b900000, irq 151
molchip_usb2_phy usb2-phy: usb2 phy power on
molchip_usb2_phy usb2-phy: usb2 phy int
molchip_usb2_phy usb2-phy: usb2 phy[0] set mode 0x1
dwc2 10d00000.dwc2: Core Release: 4.00a (snpsid=4f54400a)
dwc2 10d00000.dwc2: DWC OTG Controller
dwc2 10d00000.dwc2: new USB bus registered, assigned bus number 1
dwc2 10d00000.dwc2: irq 147, io mem 0x00000000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: DWC OTG Controller
usb usb1: Manufacturer: Linux 4.9.138 dwc2_hsotg
usb usb1: SerialNumber: 10d00000.dwc2
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
molchip_usb2_phy usb2-phy: usb2 phy[0] reset
molchip_usb2_phy usb2-phy: usb2 phy[1] set mode 0x1
dwc2 10e00000.dwc2: Core Release: 4.00a (snpsid=4f54400a)
dwc2 10e00000.dwc2: DWC OTG Controller
dwc2 10e00000.dwc2: new USB bus registered, assigned bus number 2
dwc2 10e00000.dwc2: irq 148, io mem 0x00000000
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: DWC OTG Controller
usb usb2: Manufacturer: Linux 4.9.138 dwc2_hsotg
usb usb2: SerialNumber: 10e00000.dwc2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 1 port detected
molchip_usb2_phy usb2-phy: usb2 phy[1] reset
usbcore: registered new interface driver uas
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
ata2: link offline retry
ata2: hba reset!!
mc-rtc 1a800000.rtc: rtc core: registered mc-rtc as rtc0
i2c /dev entries driver
Synopsys Designware Multimedia Card Interface Driver
mc_aes 11600000.aes: mc crypto supports aes des tdes
cryptodev: driver 1.10 loaded.
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 17
Key type dns_resolver registered
Registering SWP/SWPB emulation handler
ubi0: attaching mtd2
ata2: link offline retry
ata2: hba reset!!
ata2: SATA link down (SStatus 0 SControl 310)
data bitflips exceed thresholds 24
mc-spi-nfc 1f000000.spi_nfc: page f100 bitflips exceed the ecc strength
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 892:0, read only 64 bytes, retry
data bitflips exceed thresholds 24
mc-spi-nfc 1f000000.spi_nfc: page f100 bitflips exceed the ecc strength
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 892:0, read only 64 bytes, retry
data bitflips exceed thresholds 24
mc-spi-nfc 1f000000.spi_nfc: page f100 bitflips exceed the ecc strength
ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 892:0, read only 64 bytes, retry
data bitflips exceed thresholds 24
mc-spi-nfc 1f000000.spi_nfc: page f100 bitflips exceed the ecc strength
ubi0 error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 892:0, read 64 bytes
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.138 #1
Hardware name: ARM-MOLCHIP
[<c010df68>] (unwind_backtrace) from [<c010ac74>] (show_stack+0x10/0x14)
[<c010ac74>] (show_stack) from [<c031e2c4>] (dump_stack+0x94/0xa8)
[<c031e2c4>] (dump_stack) from [<c040647c>] (ubi_io_read+0x128/0x30c)
[<c040647c>] (ubi_io_read) from [<c0406870>] (ubi_io_read_ec_hdr+0x44/0x204)
[<c0406870>] (ubi_io_read_ec_hdr) from [<c040b6e0>] (ubi_attach+0x194/0x13fc)
[<c040b6e0>] (ubi_attach) from [<c04008d0>] (ubi_attach_mtd_dev+0x4a8/0xbc8)
[<c04008d0>] (ubi_attach_mtd_dev) from [<c0715d74>] (ubi_init+0x1d4/0x278)
[<c0715d74>] (ubi_init) from [<c01017bc>] (do_one_initcall+0x40/0x170)
[<c01017bc>] (do_one_initcall) from [<c0700d48>] (kernel_init_freeable+0x158/0x1f4)
[<c0700d48>] (kernel_init_freeable) from [<c0590fc8>] (kernel_init+0x8/0x110)
[<c0590fc8>] (kernel_init) from [<c0107690>] (ret_from_fork+0x14/0x24)
ubi0: scanning is finished
ubi0 error: vtbl_check: too large reserved_pebs 1958, good PEBs 1920
ubi0 error: vtbl_check: volume table check failed: record 0, error 9
Volume table record 0 dump:
        reserved_pebs   1958
        alignment       1
        data_pad        0
        vol_type        1
        upd_marker      0
        name_len        6
        name            rootfs
        crc             0xe2543563
ubi0 error: ubi_attach_mtd_dev: failed to attach mtd2, error -22
UBI error: cannot attach mtd2mc-rtc 1a800000.rtc: setting system clock to 1970-01-01 00:04:47 UTC (287)
VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0): error -19
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0  (driver?)
1f01            8192 mtdblock1  (driver?)
1f02          245760 mtdblock2  (driver?)
1f03             256 mtdblock3  (driver?)
0800      3907018584 sda  driver: sd
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.138 #1
Hardware name: ARM-MOLCHIP
[<c010df68>] (unwind_backtrace) from [<c010ac74>] (show_stack+0x10/0x14)
[<c010ac74>] (show_stack) from [<c031e2c4>] (dump_stack+0x94/0xa8)
[<c031e2c4>] (dump_stack) from [<c018b46c>] (panic+0xdc/0x254)
[<c018b46c>] (panic) from [<c070110c>] (mount_block_root+0x194/0x268)
[<c070110c>] (mount_block_root) from [<c07013ac>] (prepare_namespace+0xa8/0x194)
[<c07013ac>] (prepare_namespace) from [<c0700dd4>] (kernel_init_freeable+0x1e4/0x1f4)
[<c0700dd4>] (kernel_init_freeable) from [<c0590fc8>] (kernel_init+0x8/0x110)
[<c0590fc8>] (kernel_init) from [<c0107690>] (ret_from_fork+0x14/0x24)
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.138 #1
Hardware name: ARM-MOLCHIP
[<c010df68>] (unwind_backtrace) from [<c010ac74>] (show_stack+0x10/0x14)
[<c010ac74>] (show_stack) from [<c031e2c4>] (dump_stack+0x94/0xa8)
[<c031e2c4>] (dump_stack) from [<c010cdcc>] (handle_IPI+0x174/0x190)
[<c010cdcc>] (handle_IPI) from [<c0101448>] (gic_handle_irq+0x88/0x8c)
[<c0101448>] (gic_handle_irq) from [<c010b66c>] (__irq_svc+0x6c/0x90)
Exception stack(0xc0801f60 to 0xc0801fa8)
1f60: 00000000 eb6592f0 00000e36 c0113600 c0800000 c0802fe4 00000001 c0803048
1f80: c082a258 c082a258 eb673e40 00000000 2af20000 c0801fb0 c01080b0 c01080b4
1fa0: 60000013 ffffffff
[<c010b66c>] (__irq_svc) from [<c01080b4>] (arch_cpu_idle+0x38/0x3c)
[<c01080b4>] (arch_cpu_idle) from [<c0150b1c>] (cpu_startup_entry+0xd0/0x148)
[<c0150b1c>] (cpu_startup_entry) from [<c0700be4>] (start_kernel+0x308/0x314)
[<c0700be4>] (start_kernel) from [<4000807c>] (0x4000807c)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

这个错误应该是由于设置的最大逻辑块数量超出了在Nand flash中给文件系统划分出来的分区最大的物理块数量,导致内核报出ecc校验失败。

我们都知道,对于Ubi文件系统,在制作过程中是需要设置最大逻辑块的数量大小,它的公式是:分区大小/块大小=最大逻辑块数量,如:100MiB的mtd分区,物理块数量就等于100MiB/128KiB=800个,块大小可以看芯片规格数或者nand info/nand device查看。

到这里,问题的解决方法就显而易见了,内核当中也提示了

ubi0 error: vtbl_check: too large reserved_pebs 1958, good PEBs 1920

所以,我们应该把最大逻辑块数量减小

在这里我更新一个更加简单的办法:

在第一步制作ubi文件系统的时候,直接使用-c 2047,然后在卷的配置项中加入vol_flag=autoresize,这样制作出来的镜像将会跟随你的分区大小所自由的分配。在这里我也提出一个疑问,为什么-c 2047会如此特殊,而跟上面的逻辑块数量计算有如此大的差异

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值