Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#1710 - Mir3g - unable to install OpenWrt/LEDE with ubi bad blocks #6688

Open
openwrt-bot opened this issue Jul 29, 2018 · 6 comments
Open
Labels

Comments

@openwrt-bot
Copy link

Ultraboss77:

We are some users unable to complete the installation of OpenWrt/LEDE because erasing bad blocks on ubi partition fail :

[ 2.516128] # MTK NAND # : Use HW ECC
[ 2.519787] Device not found, ID: c8d1
[ 2.523528] Not Support this Device!
[ 2.527257] chip_mode=00000001
[ 2.530305] Support this Device in MTK table! c8d1
[ 2.535261] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
[ 2.541736] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xd1
[ 2.548056] nand: ESMT NAND 128MiB 3,3V 8-bit
[ 2.552406] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 2.559951] Scanning device for bad blocks
[ 2.662018] Bad eraseblock 692 at 0x000005680000
[ 2.667177] Bad eraseblock 696 at 0x000005700000
[ 2.672347] Bad eraseblock 700 at 0x000005780000
[ 2.684032] Bad eraseblock 750 at 0x000005dc0000
[ 2.720853] Bad eraseblock 978 at 0x000007a40000
[ 2.731898] 10 fixed-partitions partitions found on MTD device MT7621-NAND
[ 2.738737] Creating 10 MTD partitions on "MT7621-NAND":
[ 2.744047] 0x000000000000-0x000000080000 : "Bootloader"
[ 2.750271] 0x000000080000-0x0000000c0000 : "Config"
[ 2.756079] 0x0000000c0000-0x000000100000 : "Bdata"
[ 2.761844] 0x000000100000-0x000000140000 : "Factory"
[ 2.767685] 0x000000140000-0x000000180000 : "crash"
[ 2.773394] 0x000000180000-0x0000001c0000 : "crash_syslog"
[ 2.779670] 0x0000001c0000-0x000000200000 : "reserved0"
[ 2.785801] 0x000000200000-0x000000600000 : "kernel_stock"
[ 2.792164] 0x000000600000-0x000000a00000 : "kernel"
[ 2.797981] 0x000000a00000-0x000007f80000 : "ubi"
[ 2.804498] [mtk_nand] probe successfully!
[ 2.809315] Signature matched and data read!
[ 2.813583] load_fact_bbt success 1023
[ 2.817914] libphy: Fixed MDIO Bus: probed
[ 2.893154] libphy: mdio: probed
[ 4.296704] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[ 4.303312] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 20
[ 4.314072] NET: Registered protocol family 10
[ 4.320075] Segment Routing with IPv6
[ 4.323876] NET: Registered protocol family 17
[ 4.328373] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 4.341284] 8021q: 802.1Q VLAN Support v1.8
[ 4.348309] UBI: auto-attach mtd9
[ 4.351691] ubi0: attaching mtd9
[ 4.377159] UBI: EOF marker found, PEBs from 19 will be erased
[ 4.384201] ubi0: scanning is finished
[ 4.403913] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.411789] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.419622] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.427504] ubi0 error: do_sync_erase.part.4: cannot erase PEB 939, error -5
[ 4.434543] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.50 #0
[ 4.440520] Stack : 00000000 00000000 00000000 00000000 80607ad2 00000034 00000000 00000000
[ 4.448864] 8fc40374 8059c947 805275ac 00000001 00000001 00000001 8fc35838 1cc282d2
[ 4.457197] 00000000 00000000 80600000 00003d80 00000000 000000cd 00000007 00000000
[ 4.465531] 00000000 805a0000 0006a16f 00000000 00000000 00000000 805c0000 802edc20
[ 4.473865] 80550000 80600000 fffffffb 8f44c780 00000003 80299e30 00000004 80600004
[ 4.482200] ...
[ 4.484638] Call Trace:
[ 4.487093] [<80010558>] show_stack+0x58/0x100
[ 4.491533] [<804685ac>] dump_stack+0x9c/0xe0
[ 4.495871] [<802ef678>] do_sync_erase.part.4+0x118/0x2ac
[ 4.501250] [<802efb58>] ubi_io_sync_erase+0x2ac/0x2e4
[ 4.506365] [<802f0418>] sync_erase.isra.4+0x150/0x25c
[ 4.511482] [<802f0a4c>] __erase_worker+0x4c/0x4b0
[ 4.516250] [<802f0f14>] erase_worker+0x64/0x8c
[ 4.520765] [<802eff70>] do_work+0xf8/0x13c
[ 4.524930] [<802f280c>] ubi_wl_get_peb+0xcc/0x260
[ 4.529697] [<802eb2d8>] try_write_vid_and_data+0x54/0x200
[ 4.535160] [<802ecb54>] ubi_eba_atomic_leb_change+0x208/0x314
[ 4.541000] [<802e3120>] ubi_update_layout_vol+0x40/0x74
[ 4.546287] [<802e37dc>] ubi_change_vtbl_record+0xb0/0x104
[ 4.551747] [<802e5714>] ubi_resize_volume+0x254/0x4c4
[ 4.556860] [<802e6ae0>] autoresize+0x144/0x1cc
[ 4.561375] [<802e7c88>] ubi_attach_mtd_dev+0x730/0xbe8
[ 4.566599] [<805dd428>] ubi_init+0x2a8/0x360
[ 4.570939] [<80005650>] do_one_initcall+0xd0/0x1a0
[ 4.575813] [<805c5d80>] kernel_init_freeable+0x168/0x228
[ 4.581209] [<8047f6bc>] kernel_init+0x10/0x10c
[ 4.585719] [<8000b098>] ret_from_kernel_thread+0x14/0x1c
[ 4.591175] ubi0 error: __erase_worker: failed to erase PEB 939, error -5
[ 4.597931] ubi0: mark PEB 939 as bad

A user (@tanonn, thanks to him) successful installed LEDE by shrinking the ubi partition (85% of the original size) then made a custom build.

Could you handle the erasing of bad blocks for next builds ?

@openwrt-bot
Copy link
Author

mkresin:

Would you please provide a full bootlog.

So far I can't spot anything wrong. Block 939 is bad, is marked as bad (ubi0: mark PEB 939 as bad) and will not be used any more.

The UBI format should continue afterwards. Hard to say what really happens due to the truncated log.

@openwrt-bot
Copy link
Author

Ultraboss77:

I thought this part was sufficient.
Here is the full boot log :

            MT7621   stage1 code 10:33:11 (ASIC)
            CPU=50000000 HZ BUS=12500000 HZ

==================================================================
Change MPLL source from XTAL to CR...
do MEMPLL setting..
MEMPLL Config : 0x11100000
3PLL mode + External loopback
=== XTAL-40Mhz === DDR-1200Mhz ===
PLL4 FB_DL: 0x10, 1/0 = 540/484 41000000
PLL2 FB_DL: 0x18, 1/0 = 650/374 61000000
PLL3 FB_DL: 0x1a, 1/0 = 620/404 69000000
do DDR setting..[00320381]
Apply DDR3 Setting...(use customer AC)
0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120
--------------------------------------------------------------------------------
0000:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0001:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0002:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0003:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0004:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0005:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0006:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0007:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0008:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0009:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000A:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000B:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000C:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000D:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000E:| 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1
000F:| 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0
0010:| 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0
0011:| 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
0012:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0013:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0014:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0015:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0016:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0017:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0018:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0019:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001A:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001B:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001C:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001D:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001E:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
001F:| 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
rank 0 coarse = 15
rank 0 fine = 72
B:| 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0
opt_dle value:11
DRAMC_R0DELDLY[018]=00002222

            RX      DQS perbit delay software calibration

==================================================================
1.0-15 bit dq delay value

bit| 0 1 2 3 4 5 6 7 8 9

0 | 9 7 8 9 7 7 7 5 6 6
10 | 8 7 7 10 7 9

==================================================================
2.dqs window
x=pass dqs delay value (min~max)center
y=0-7bit DQ of every group
input delay:DQS0 =34 DQS1 = 34

bit DQS0 bit DQS1
0 (166)33 8 (165)33
1 (065)32 9 (165)33
2 (165)33 10 (168)34
3 (164)32 11 (162)31
4 (164)32 12 (168)34
5 (167)34 13 (168)34
6 (165)33 14 (168)34
7 (069)34 15 (266)34

3.dq delay value last

bit| 0 1 2 3 4 5 6 7 8 9

0 | 10 9 9 11 9 7 8 5 7 7
10 | 8 10 7 10 7 9

==================================================================
TX perbyte calibration

DQS loop = 15, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqsdly_pass[0]=15, finish count=1
dqs_perbyte_dly.last_dqsdly_pass[1]=15, finish count=2
DQ loop=15, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqdly_pass[0]=15, finish count=1
dqs_perbyte_dly.last_dqdly_pass[1]=15, finish count=2
byte:0, (DQS,DQ)=(8,8)
byte:1, (DQS,DQ)=(8,8)
20,data:88
[EMI] DRAMC calibration passed

===================================================================
MT7621 stage1 code done
CPU=50000000 HZ BUS=12500000 HZ

U-Boot 1.1.3 (Apr 17 2017 - 17:00:02)

Board: Ralink APSoC DRAM: 256 MB
Power on memory test. Memory size= 256 MB...OK!
relocate_code Pointer at: 8ffac000

Config XHCI 40M PLL
Allocate 16 byte aligned buffer: 8ffdffd0
Enable NFI Clock

MTK NAND # : Use HW ECC

NAND ID [C8 D1 80 95 42]
Device not found, ID: c8d1
Not Support this Device!
chip_mode=00000001
Support this Device in MTK table! c8d1
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 1023
load fact bbt success
[mtk_nand] probe successfully!
mtd->writesize=2048 mtd->oobsize=64, mtd->erasesize=131072 devinfo.iowidth=8
..============================================
Ralink UBoot Version: 5.0.0.0

ASIC MT7621A DualCore (MAC to MT7530 Mode)
DRAM_CONF_FROM: Auto-Detection
DRAM_TYPE: DDR3
DRAM bus: 16 bit
Xtal Mode=5 OCP Ratio=1/4
Flash component: NAND Flash
Date:Apr 17 2017 Time:17:00:02

icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:256, ways:4, linesz:32 ,total:32768

The CPU freq = 880 MHZ

estimate memory size =256 Mbytes
#Reset_MT7530
set LAN/WAN LWLLL

Please choose the operation:
1: Load system code to SDRAM via TFTP.
2: Load system code then write to Flash via TFTP.
3: Boot system code via Flash (default).
4: Entr boot command line interface.
7: Load Boot Loader code then write to Flash via Serial.
9: Load Boot Loader code then write to Flash via TFTP. 0
Booting System 2
..Erasing NAND Flash...
ranand_erase: start:80000, len:20000
.Writing to NAND Flash...
done

3: System Boot system code via Flash.

Booting image at bc600000 ...

Image Name: MIPS OpenWrt Linux-4.14.50
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 1949270 Bytes = 1.9 MB
Load Address: 80001000
Entry Point: 80001000
.............................. Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
commandline uart_en=0 factory_mode=0 usb_u3=0
No initrd

Transferring control to Linux (at address 80001000) ...

Giving linux memsize in MB, 256

Starting kernel ...

[ 0.000000] Linux version 4.14.50 (buildbot@slashdirt-02) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7310-65c0530)) #0 SMP Sat Jun 23 07:47:05 2018
[ 0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[ 0.000000] MIPS: machine is Xiaomi Mi Router 3G
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 10000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] VPE topology {2,2} total 4
[ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x000000000fffffff]
[ 0.000000] HighMem empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x000000000fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[ 0.000000] random: get_random_bytes called from start_kernel+0x90/0x4ac with crng_init=0
[ 0.000000] percpu: Embedded 14 pages/cpu @81210000 s26256 r8192 d22896 u57344
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[ 0.000000] Writing ErrCtl register=00001100
[ 0.000000] Readback ErrCtl register=00001100
[ 0.000000] Memory: 253148K/262144K available (4631K kernel code, 236K rwdata, 1028K rodata, 236K init, 275K bss, 8996K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] NR_IRQS: 256
[ 0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4343773742 ns
[ 0.000010] sched_clock: 32 bits at 440MHz, resolution 2ns, wraps every 4880645118ns
[ 0.007810] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688)
[ 0.073967] pid_max: default: 32768 minimum: 301
[ 0.078736] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.085243] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.093934] Hierarchical SRCU implementation.
[ 0.098996] smp: Bringing up secondary CPUs ...
[ 0.105525] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.105534] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.105547] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.105690] CPU1 revision is: 0001992f (MIPS 1004Kc)
[ 0.163736] Synchronize counters for CPU 1: done.
[ 0.199648] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.199656] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.199663] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.199737] CPU2 revision is: 0001992f (MIPS 1004Kc)
[ 0.254790] Synchronize counters for CPU 2: done.
[ 0.286593] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
[ 0.286601] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[ 0.286608] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
[ 0.286685] CPU3 revision is: 0001992f (MIPS 1004Kc)
[ 0.339966] Synchronize counters for CPU 3: done.
[ 0.369821] smp: Brought up 1 node, 4 CPUs
[ 0.377508] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.387294] futex hash table entries: 1024 (order: 3, 32768 bytes)
[ 0.393594] pinctrl core: initialized pinctrl subsystem
[ 0.400282] NET: Registered protocol family 16
[ 0.415373] pull PCIe RST: RALINK_RSTCTRL = 4000000
[ 0.720511] release PCIe RST: RALINK_RSTCTRL = 7000000
[ 0.725544] ***** Xtal 40MHz *****
[ 0.728914] release PCIe RST: RALINK_RSTCTRL = 7000000
[ 0.734021] Port 0 N_FTS = 1b102800
[ 0.737466] Port 1 N_FTS = 1b102800
[ 0.740926] Port 2 N_FTS = 1b102800
[ 1.895904] PCIE2 no card, disable it(RST&CLK)
[ 1.900249] -> 21007f2
[ 1.902669] PCIE0 enabled
[ 1.905258] PCIE1 enabled
[ 1.907879] PCI host bridge /pcie@1e140000 ranges:
[ 1.912624] MEM 0x0000000060000000..0x000000006fffffff
[ 1.917791] IO 0x000000001e160000..0x000000001e16ffff
[ 1.922993] PCI coherence region base: 0x8fc35cf0, mask/settings: 0x60000000
[ 1.938502] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.944340] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.950053] mt7621_gpio 1e000600.gpio: registering 32 gpios
[ 1.957561] PCI host bridge to bus 0000:00
[ 1.961587] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[ 1.968451] pci_bus 0000:00: root bus resource [io 0xffffffff]
[ 1.974277] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 1.981035] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[ 1.989615] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 1.997540] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[ 2.006619] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[ 2.013161] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[ 2.020041] pci 0000:00:01.0: BAR 0: no space for [mem size 0x80000000]
[ 2.026630] pci 0000:00:01.0: BAR 0: failed to assign [mem size 0x80000000]
[ 2.033525] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[ 2.040281] pci 0000:00:01.0: BAR 8: assigned [mem 0x60100000-0x601fffff]
[ 2.047000] pci 0000:00:01.0: BAR 9: assigned [mem 0x60200000-0x602fffff pref]
[ 2.054186] pci 0000:00:00.0: BAR 1: assigned [mem 0x60300000-0x6030ffff]
[ 2.060911] pci 0000:00:01.0: BAR 1: assigned [mem 0x60310000-0x6031ffff]
[ 2.067677] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff]
[ 2.074393] pci 0000:00:00.0: PCI bridge to [bus 01]
[ 2.079334] pci 0000:00:00.0: bridge window [mem 0x60000000-0x600fffff]
[ 2.086060] pci 0000:02:00.0: BAR 0: assigned [mem 0x60100000-0x601fffff 64bit]
[ 2.093336] pci 0000:02:00.0: BAR 6: assigned [mem 0x60200000-0x6020ffff pref]
[ 2.100476] pci 0000:00:01.0: PCI bridge to [bus 02]
[ 2.105422] pci 0000:00:01.0: bridge window [mem 0x60100000-0x601fffff]
[ 2.112140] pci 0000:00:01.0: bridge window [mem 0x60200000-0x602fffff pref]
[ 2.120592] clocksource: Switched to clocksource GIC
[ 2.126911] NET: Registered protocol family 2
[ 2.132059] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[ 2.138943] TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
[ 2.145386] TCP: Hash tables configured (established 2048 bind 2048)
[ 2.151801] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 2.157563] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 2.164052] NET: Registered protocol family 1
[ 2.400548] 4 CPUs re-calibrate udelay(lpj = 2924544)
[ 2.406793] Crashlog allocated RAM at address 0x3f00000
[ 2.412125] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[ 2.424517] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 2.430260] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 2.441486] random: fast init done
[ 2.446572] io scheduler noop registered
[ 2.450405] io scheduler deadline registered (default)
[ 2.456614] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[ 2.465881] console [ttyS0] disabled
[ 2.469428] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 18, base_baud = 3125000) is a 16550A
[ 2.478471] console [ttyS0] enabled
[ 2.478471] console [ttyS0] enabled
[ 2.485387] bootconsole [early0] disabled
[ 2.485387] bootconsole [early0] disabled
[ 2.494199] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 2.501083] MediaTek Nand driver init, version v2.1 Fix AHB virt2phys error
[ 2.508155] Allocate 16 byte aligned buffer: 80638010
[ 2.513262] Enable NFI Clock
[ 2.516128] # MTK NAND # : Use HW ECC
[ 2.519787] Device not found, ID: c8d1
[ 2.523528] Not Support this Device!
[ 2.527257] chip_mode=00000001
[ 2.530305] Support this Device in MTK table! c8d1
[ 2.535261] [NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
[ 2.541736] nand: device found, Manufacturer ID: 0xc8, Chip ID: 0xd1
[ 2.548056] nand: ESMT NAND 128MiB 3,3V 8-bit
[ 2.552406] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 2.559951] Scanning device for bad blocks
[ 2.662018] Bad eraseblock 692 at 0x000005680000
[ 2.667177] Bad eraseblock 696 at 0x000005700000
[ 2.672347] Bad eraseblock 700 at 0x000005780000
[ 2.684032] Bad eraseblock 750 at 0x000005dc0000
[ 2.720853] Bad eraseblock 978 at 0x000007a40000
[ 2.731898] 10 fixed-partitions partitions found on MTD device MT7621-NAND
[ 2.738737] Creating 10 MTD partitions on "MT7621-NAND":
[ 2.744047] 0x000000000000-0x000000080000 : "Bootloader"
[ 2.750271] 0x000000080000-0x0000000c0000 : "Config"
[ 2.756079] 0x0000000c0000-0x000000100000 : "Bdata"
[ 2.761844] 0x000000100000-0x000000140000 : "Factory"
[ 2.767685] 0x000000140000-0x000000180000 : "crash"
[ 2.773394] 0x000000180000-0x0000001c0000 : "crash_syslog"
[ 2.779670] 0x0000001c0000-0x000000200000 : "reserved0"
[ 2.785801] 0x000000200000-0x000000600000 : "kernel_stock"
[ 2.792164] 0x000000600000-0x000000a00000 : "kernel"
[ 2.797981] 0x000000a00000-0x000007f80000 : "ubi"
[ 2.804498] [mtk_nand] probe successfully!
[ 2.809315] Signature matched and data read!
[ 2.813583] load_fact_bbt success 1023
[ 2.817914] libphy: Fixed MDIO Bus: probed
[ 2.893154] libphy: mdio: probed
[ 4.296704] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver
[ 4.303312] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 20
[ 4.314072] NET: Registered protocol family 10
[ 4.320075] Segment Routing with IPv6
[ 4.323876] NET: Registered protocol family 17
[ 4.328373] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 4.341284] 8021q: 802.1Q VLAN Support v1.8
[ 4.348309] UBI: auto-attach mtd9
[ 4.351691] ubi0: attaching mtd9
[ 4.377159] UBI: EOF marker found, PEBs from 19 will be erased
[ 4.384201] ubi0: scanning is finished
[ 4.403913] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.411789] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.419622] ubi0 warning: do_sync_erase.part.4: error -5 while erasing PEB 939, retry
[ 4.427504] ubi0 error: do_sync_erase.part.4: cannot erase PEB 939, error -5
[ 4.434543] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.14.50 #0
[ 4.440520] Stack : 00000000 00000000 00000000 00000000 80607ad2 00000034 00000000 00000000
[ 4.448864] 8fc40374 8059c947 805275ac 00000001 00000001 00000001 8fc35838 1cc282d2
[ 4.457197] 00000000 00000000 80600000 00003d80 00000000 000000cd 00000007 00000000
[ 4.465531] 00000000 805a0000 0006a16f 00000000 00000000 00000000 805c0000 802edc20
[ 4.473865] 80550000 80600000 fffffffb 8f44c780 00000003 80299e30 00000004 80600004
[ 4.482200] ...
[ 4.484638] Call Trace:
[ 4.487093] [<80010558>] show_stack+0x58/0x100
[ 4.491533] [<804685ac>] dump_stack+0x9c/0xe0
[ 4.495871] [<802ef678>] do_sync_erase.part.4+0x118/0x2ac
[ 4.501250] [<802efb58>] ubi_io_sync_erase+0x2ac/0x2e4
[ 4.506365] [<802f0418>] sync_erase.isra.4+0x150/0x25c
[ 4.511482] [<802f0a4c>] __erase_worker+0x4c/0x4b0
[ 4.516250] [<802f0f14>] erase_worker+0x64/0x8c
[ 4.520765] [<802eff70>] do_work+0xf8/0x13c
[ 4.524930] [<802f280c>] ubi_wl_get_peb+0xcc/0x260
[ 4.529697] [<802eb2d8>] try_write_vid_and_data+0x54/0x200
[ 4.535160] [<802ecb54>] ubi_eba_atomic_leb_change+0x208/0x314
[ 4.541000] [<802e3120>] ubi_update_layout_vol+0x40/0x74
[ 4.546287] [<802e37dc>] ubi_change_vtbl_record+0xb0/0x104
[ 4.551747] [<802e5714>] ubi_resize_volume+0x254/0x4c4
[ 4.556860] [<802e6ae0>] autoresize+0x144/0x1cc
[ 4.561375] [<802e7c88>] ubi_attach_mtd_dev+0x730/0xbe8
[ 4.566599] [<805dd428>] ubi_init+0x2a8/0x360
[ 4.570939] [<80005650>] do_one_initcall+0xd0/0x1a0
[ 4.575813] [<805c5d80>] kernel_init_freeable+0x168/0x228
[ 4.581209] [<8047f6bc>] kernel_init+0x10/0x10c
[ 4.585719] [<8000b098>] ret_from_kernel_thread+0x14/0x1c
[ 4.591175] ubi0 error: __erase_worker: failed to erase PEB 939, error -5
[ 4.597931] ubi0: mark PEB 939 as bad

@openwrt-bot
Copy link
Author

mkresin:

I thought this part was sufficient.

It was. Failed to get that the boot stops with the mark PEB as bad message.

//edit

Had a quick look at the code and suspect that something in [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/ramips/patches-4.14/0039-mtd-add-mt7621-nand-support.patch;h=d50e689110eab3e8c140261600561b150b960089;hb=b9bd3285c7c6fbc60374b05ac2da9be41ce75651#l3049|mtk_nand_block_markbad]] causes the hang.

More detailed debugging would require access to the hardware/need to be done by someone with the hardware.

@openwrt-bot
Copy link
Author

majuss:

I have exactly the same problem, still not fixed with latest image :(

@openwrt-bot
Copy link
Author

pablos891:

I have the same issue. The OpenWrt bricks my Mir3g.

Starting from this post: https://forum.openwrt.org/t/xiaomi-wifi-router-3g/5377/1028?u=pablos891
there was some discussion about this problem.
@juppin and @tanonn discussed and figured out the solution.
Please look - maybe this finally can help to solve the problem.

@openwrt-bot
Copy link
Author

ivanich:

Having the same issue with edgerouterx
[ 0.993110] Scanning device for bad blocks
[ 2.584172] Bad eraseblock 1246 at 0x000009bc0000
[ 2.709755] Bad eraseblock 1338 at 0x00000a740000
[ 3.602941] Bad eraseblock 2034 at 0x00000fe40000
[ 3.618037] Bad eraseblock 2039 at 0x00000fee0000
[ 6.599479] ubi0: good PEBs: 1978, bad PEBs: 4, corrupted PEBs: 0
[ 6.644357] ubi0: available PEBs: 0, total reserved PEBs: 1978, PEBs reserved for bad PEB handling: 36

So every second upgrade bricks router, can we do some workaround for this issue in the new 5.4 mtd mt7621 driver?
Some additional info freifunk-gluon/gluon#1937

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant