LinuxImage2.8 QT5 over T20 Not tolerant of loss of power

I compiled LinuxImage2.8 with QT5 (angstrom-qt5-x11-image) for ColibriT20 and is working, only problem is that the ubifs is practically always corrupted after a power cut.

As said in this post LinuxImage 2.3 seems to work well after a loss of power, so I tried to compile image 2.3 with Qt5. Unfortunately, after many attempts (weeks trying to make the system compile well) I couldn’t do it.

Another alternative that I found possible as it says here and here is to revert this commit in the branch tegra of the Linux kernel repo, and with this, yaffs are used again as in image 2.3.

These are my complete steps:

  • Compile angstrom-qt5-x11-image succesfull and running in my Colibri T20.

  • Then I followed exactly this instructions to build linux kernel for Colibri T20, Summarizing this step:

    wget -c https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
     
     tar xvf gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz
     ln -s gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf gcc-linaro
     
     export ARCH=arm
     export PATH=~/gcc-linaro/bin/:$PATH
     export CROSS_COMPILE=arm-linux-gnueabihf-
     
     git clone -b tegra git://git.toradex.com/linux-toradex.git 
     cd linux-toradex
     
     git revert 834b98d0367931d6bec5a48fe87fddd9b877f688
     
     make colibri_t20_defconfig
     
     make -j3 zImage 2>&1 | tee build.log
    

Kernel compiled succeced.

So the I update the kernel, I prepared my sd with my compiled Colibri-T20_Qt5-X11-Image_2.8b6-20191128 image, and from the u-boot command line:

run setupdate
run prepare_ubi
run update_kernel

Finally, when kernel starts, an error occurs (I put only the last part because the first part is repeated many times):

[   47.060894] UBI warning: ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 4072:4096, read ony
[   47.061707] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4074:0, read only 64y
[   47.062062] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4074:0, read only 64y
[   47.062439] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4074:0, read only 64y
[   47.062796] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4074:0, read 64 bytes
[   47.062818] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   47.062834] [<c056f614>] (dump_stack+0x20/0x24) from [<c032d128>] (ubi_io_read+0x1f0/0x2b0)
[   47.062849] [<c032d128>] (ubi_io_read+0x1f0/0x2b0) from [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4)
[   47.062864] [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4) from [<c03317e0>] (ubi_attach+0x1d4/0x1120)
[   47.062883] [<c03317e0>] (ubi_attach+0x1d4/0x1120) from [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50)
[   47.062901] [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50) from [<c07ef844>] (ubi_init+0x25c/0x2c8)
[   47.062918] [<c07ef844>] (ubi_init+0x25c/0x2c8) from [<c0008804>] (do_one_initcall+0x140/0x168)
[   47.062934] [<c0008804>] (do_one_initcall+0x140/0x168) from [<c07d697c>] (kernel_init+0x100/0x130)
[   47.062952] [<c07d697c>] (kernel_init+0x100/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   47.063318] UBI warning: ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 4074:4096, read ony
[   47.064400] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4076:0, read only 64y
[   47.064778] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4076:0, read only 64y
[   47.065137] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4076:0, read only 64y
[   47.065502] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4076:0, read 64 bytes
[   47.065523] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   47.065539] [<c056f614>] (dump_stack+0x20/0x24) from [<c032d128>] (ubi_io_read+0x1f0/0x2b0)
[   47.065553] [<c032d128>] (ubi_io_read+0x1f0/0x2b0) from [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4)
[   47.065569] [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4) from [<c03317e0>] (ubi_attach+0x1d4/0x1120)
[   47.065588] [<c03317e0>] (ubi_attach+0x1d4/0x1120) from [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50)
[   47.065607] [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50) from [<c07ef844>] (ubi_init+0x25c/0x2c8)
[   47.065624] [<c07ef844>] (ubi_init+0x25c/0x2c8) from [<c0008804>] (do_one_initcall+0x140/0x168)
[   47.065640] [<c0008804>] (do_one_initcall+0x140/0x168) from [<c07d697c>] (kernel_init+0x100/0x130)
[   47.065658] [<c07d697c>] (kernel_init+0x100/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   47.066023] UBI warning: ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 4076:4096, read ony
[   47.067088] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4078:0, read only 64y
[   47.067464] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4078:0, read only 64y
[   47.067823] UBI warning: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4078:0, read only 64y
[   47.068190] UBI error: ubi_io_read: error -74 (ECC error) while reading 64 bytes from PEB 4078:0, read 64 bytes
[   47.068211] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   47.068227] [<c056f614>] (dump_stack+0x20/0x24) from [<c032d128>] (ubi_io_read+0x1f0/0x2b0)
[   47.068242] [<c032d128>] (ubi_io_read+0x1f0/0x2b0) from [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4)
[   47.068257] [<c032d440>] (ubi_io_read_ec_hdr+0x7c/0x1d4) from [<c03317e0>] (ubi_attach+0x1d4/0x1120)
[   47.068276] [<c03317e0>] (ubi_attach+0x1d4/0x1120) from [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50)
[   47.068296] [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50) from [<c07ef844>] (ubi_init+0x25c/0x2c8)
[   47.068313] [<c07ef844>] (ubi_init+0x25c/0x2c8) from [<c0008804>] (do_one_initcall+0x140/0x168)
[   47.068328] [<c0008804>] (do_one_initcall+0x140/0x168) from [<c07d697c>] (kernel_init+0x100/0x130)
[   47.068346] [<c07d697c>] (kernel_init+0x100/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   47.068713] UBI warning: ubi_io_read: error -74 (ECC error) while reading 4096 bytes from PEB 4078:4096, read ony
[   47.069424] UBI: scanning is finished
[   47.071527] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3060:8192, read oy
[   47.073035] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3060:8192, read oy
[   47.074561] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3060:8192, read oy
[   47.076111] UBI error: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3060:8192, read 245s
[   47.076135] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   47.076152] [<c056f614>] (dump_stack+0x20/0x24) from [<c032d128>] (ubi_io_read+0x1f0/0x2b0)
[   47.076171] [<c032d128>] (ubi_io_read+0x1f0/0x2b0) from [<c03253b4>] (ubi_read_volume_table+0x398/0x8d4)
[   47.076190] [<c03253b4>] (ubi_read_volume_table+0x398/0x8d4) from [<c033254c>] (ubi_attach+0xf40/0x1120)
[   47.076208] [<c033254c>] (ubi_attach+0xf40/0x1120) from [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50)
[   47.076230] [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50) from [<c07ef844>] (ubi_init+0x25c/0x2c8)
[   47.076247] [<c07ef844>] (ubi_init+0x25c/0x2c8) from [<c0008804>] (do_one_initcall+0x140/0x168)
[   47.076265] [<c0008804>] (do_one_initcall+0x140/0x168) from [<c07d697c>] (kernel_init+0x100/0x130)
[   47.076285] [<c07d697c>] (kernel_init+0x100/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   47.077845] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3061:8192, read oy
[   47.079372] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3061:8192, read oy
[   47.081267] UBI warning: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3061:8192, read oy
[   47.083367] UBI error: ubi_io_read: error -74 (ECC error) while reading 24576 bytes from PEB 3061:8192, read 245s
[   47.083391] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   47.083408] [<c056f614>] (dump_stack+0x20/0x24) from [<c032d128>] (ubi_io_read+0x1f0/0x2b0)
[   47.083427] [<c032d128>] (ubi_io_read+0x1f0/0x2b0) from [<c03253b4>] (ubi_read_volume_table+0x398/0x8d4)
[   47.083445] [<c03253b4>] (ubi_read_volume_table+0x398/0x8d4) from [<c033254c>] (ubi_attach+0xf40/0x1120)
[   47.083462] [<c033254c>] (ubi_attach+0xf40/0x1120) from [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50)
[   47.083483] [<c03281f4>] (ubi_attach_mtd_dev+0x5e8/0xb50) from [<c07ef844>] (ubi_init+0x25c/0x2c8)
[   47.083500] [<c07ef844>] (ubi_init+0x25c/0x2c8) from [<c0008804>] (do_one_initcall+0x140/0x168)
[   47.083516] [<c0008804>] (do_one_initcall+0x140/0x168) from [<c07d697c>] (kernel_init+0x100/0x130)
[   47.083535] [<c07d697c>] (kernel_init+0x100/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   47.083551] UBI error: vtbl_check: bad CRC at record 0: 0x25c3c543, not 0x000000
[   47.083559] Volume table record 0 dump:
[   47.083564]  reserved_pebs   0
[   47.083568]  alignment       0
[   47.083572]  data_pad        0
[   47.083577]  vol_type        0
[   47.083581]  upd_marker      0
[   47.083585]  name_len        0
[   47.083589]  name            NULL
[   47.083597] UBI error: vtbl_check: bad CRC at record 0: 0x25c3c543, not 0x000000
[   47.083604] Volume table record 0 dump:
[   47.083608]  reserved_pebs   0
[   47.083613]  alignment       0
[   47.083617]  data_pad        0
[   47.083621]  vol_type        0
[   47.083625]  upd_marker      0
[   47.083629]  name_len        0
[   47.083633]  name            NULL
[   47.083639] UBI error: process_lvol: both volume tables are corrupted
[   85.133870] UBI error: ubi_attach_mtd_dev: failed to attach mtd3, error -22
[   85.143671] UBI error: ubi_init: cannot attach mtd3
[   85.151500] sd 0:0:0:0: [sda] No Caching mode page present
[   85.152168] input: gpio-keys as /devices/platform/gpio-keys.0/input/input1
[   85.169121] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   85.177765] tegra_rtc tegra_rtc: setting system clock to 1970-01-01 00:03:05 UTC (185)
[   85.194226] sd 0:0:0:0: [sda] No Caching mode page present
[   85.202563] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   85.212883]  sda: sda1
[   85.221595] sd 0:0:0:0: [sda] No Caching mode page present
[   85.230232] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   85.239538] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   85.248396] UBIFS error (pid 1): ubifs_mount: cannot open "ubi0:rootfs", error -19
[   85.262439] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(0,0)
[   85.272895] Please append a correct "root=" boot option; here are the available partitions:
[   85.288236] 1f00            2048 mtdblock0  (driver?)
[   85.296997] 1f01            1024 mtdblock1  (driver?)
[   85.305767] 1f02            1024 mtdblock2  (driver?)
[   85.314495] 1f03         1044480 mtdblock3  (driver?)
[   85.323208] 0800         1966080 sda  driver: sd
[   85.331553]   0801         1966064 sda1 00000000-0000-0000-0000-000000000000
[   85.342415] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[   85.358195] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   85.374460] [<c056f614>] (dump_stack+0x20/0x24) from [<c056f7a4>] (panic+0x7c/0x194)
[   85.390029] [<c056f7a4>] (panic+0x7c/0x194) from [<c07d6d4c>] (mount_block_root+0x1b8/0x218)
[   85.406425] [<c07d6d4c>] (mount_block_root+0x1b8/0x218) from [<c07d6f4c>] (prepare_namespace+0x90/0x194)
[   85.424215] [<c07d6f4c>] (prepare_namespace+0x90/0x194) from [<c07d6964>] (kernel_init+0xe8/0x130)
[   85.441809] [<c07d6964>] (kernel_init+0xe8/0x130) from [<c000ea40>] (kernel_thread_exit+0x0/0x8)
[   85.459545] CPU1: stopping
[   85.466618] [<c0014278>] (unwind_backtrace+0x0/0xe8) from [<c056f614>] (dump_stack+0x20/0x24)
[   85.483939] [<c056f614>] (dump_stack+0x20/0x24) from [<c00085e8>] (do_IPI+0xf8/0x1a8)
[   85.500698] [<c00085e8>] (do_IPI+0xf8/0x1a8) from [<c000da78>] (__irq_svc+0x38/0xd0)
[   85.517981] Exception stack(0xd60abf10 to 0xd60abf58)
[   85.528047] bf00:                                     00000001 00000000 00000000 000f4240
[   85.546297] bf20: d0173efa 00000013 00000000 cd837410 0000406a cd837400 c089ac84 d60abf84
[   85.564534] bf40: 3b9ac9ff d60abf58 c0267bd0 c0034b14 20000013 ffffffff
[   85.576259] [<c000da78>] (__irq_svc+0x38/0xd0) from [<c0034b14>] (tegra_idle_enter_lp3+0xe4/0xf4)
[   85.595131] [<c0034b14>] (tegra_idle_enter_lp3+0xe4/0xf4) from [<c03cba28>] (cpuidle_idle_call+0x1bc/0x30c)
[   85.614906] [<c03cba28>] (cpuidle_idle_call+0x1bc/0x30c) from [<c000eed4>] (cpu_idle+0xc0/0x104)
[   85.633697] [<c000eed4>] (cpu_idle+0xc0/0x104) from [<c056cb5c>] (secondary_start_kernel+0x120/0x140)
[   85.652925] [<c056cb5c>] (secondary_start_kernel+0x120/0x140) from [<0056c494>] (0x56c494)

Finally, I so frustrated… could you tell me if this option is valid (reverting that commit in kernel to make the system powercut tolerant) and in that case what am I doing wrong?

Please, I’m trying really hard to solve this issue, thanks!

Either you use the NvFlash based update stuff relying on YAFFS2 as in BSP 2.3 or the UBI based stuff (which suffers power-cut tolerance) as in BSP 2.8. One can not mix and match UBI with YAFFS2 without also using resp. update stuff. So if reverting to YAFFS2 you will also need to rely on the update stuff from BSP 2.3.