Ar71xx: kernel panic / hang after "random: fast init done" in 4.9.xx

U-Boot 2019.01-00079-g3420a6fc6e-dirty (Feb 20 2019 - 11:28:18 +0800)

Qualcomm Atheros QCA9533 ver 2 rev 0
Model: AP143 Reference Board
DRAM:  64 MiB
Loading Environment from SPI Flash... SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB, mapped at 9f000000
*** Warning - bad CRC, using default environment

In:    uart@18020000
Out:   uart@18020000
Err:   uart@18020000
Net:   
Warning: eth1@0x1a000000 (eth0) using random MAC address - c2:74:c6:0d:82:89
eth0: eth1@0x1a000000
Hit any key to stop autoboot:  0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB, mapped at 9f000000
## Booting kernel from Legacy Image at 9fe80000 ...
   Image Name:   MIPS OpenWrt Linux-4.9.154
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1400578 Bytes = 1.3 MiB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
[    0.000000] Linux version 4.9.154 (xxx@xxx-PC) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7329-0b99f08a64) ) #0 Wed Feb 20 03:53:47 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line:  board=RS-WR818A console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,14464k(rootfs),1472k(kernel),64k(art)ro,15936k@0x60000(firmware) rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=000677ed
[    0.000000] Readback ErrCtl register=000677ed
[    0.000000] Memory: 59840K/65536K available (3183K kernel code, 165K rwdata, 800K rodata, 324K init, 205K bss, 5696K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:654.687MHz, DDR:382.836MHz, AHB:218.229MHz, Ref:25.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5838695398 ns
[    0.000009] sched_clock: 32 bits at 327MHz, resolution 3ns, wraps every 6560331774ns
[    0.008941] Calibrating delay loop... 434.99 BogoMIPS (lpj=2174976)
[    0.071998] pid_max: default: 32768 minimum: 301
[    0.077388] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.084969] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.096539] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.107939] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.115636] NET: Registered protocol family 16
[    0.122561] MIPS: machine is ROSINSON RS-WR818A
[    0.133213] ar71xx: invalid MDIO id 1
[    0.628324] clocksource: Switched to clocksource MIPS
[    0.635432] NET: Registered protocol family 2
[    0.641446] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.649467] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.656843] TCP: Hash tables configured (established 1024 bind 1024)
[    0.664294] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.671017] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.678643] NET: Registered protocol family 1
[    0.689490] Crashlog allocated RAM at address 0x3f00000
[    0.697159] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.711735] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.718540] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.741601] io scheduler noop registered
[    0.746073] io scheduler deadline registered (default)
[    0.752546] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.760340] console [ttyS0] disabled
[    0.784539] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[    0.794548] console [ttyS0] enabled
[    0.794548] console [ttyS0] enabled
[    0.802118] bootconsole [early0] disabled
[    0.802118] bootconsole [early0] disabled
[    0.815483] m25p80 spi0.0: found w25q128, expected m25p80
[    0.831095] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.836025] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.842205] Creating 7 MTD partitions on "spi0.0":
[    0.847298] 0x000000000000-0x000000040000 : "u-boot"
[    0.854936] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.863082] 0x000000050000-0x000000060000 : "factory"
[    0.871008] 0x000000060000-0x000000e80000 : "rootfs"
[    0.878002] mtd: device 3 (rootfs) set to be root filesystem
[    0.884102] 1 squashfs-split partitions found on MTD device rootfs
[    0.890612] 0x0000002d0000-0x000000e80000 : "rootfs_data"
[    0.898902] 0x000000e80000-0x000000ff0000 : "kernel"
[    0.906630] 0x000000ff0000-0x000001000000 : "art"
[    0.914095] 0x000000060000-0x000000ff0000 : "firmware"
[    0.923259] libphy: Fixed MDIO Bus: probed
[    0.954923] libphy: ag71xx_mdio: probed
[    1.591279] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd042, driver=Generic PHY]
[    1.601599] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    2.230880] ag71xx-mdio.1: Found an AR934X built-in switch
[    2.284308] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[    2.292212] NET: Registered protocol family 10
[    2.300721] NET: Registered protocol family 17
[    2.305616] 8021q: 802.1Q VLAN Support v1.8
[    2.316927] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
[    2.327181] Freeing unused kernel memory: 324K
[    2.331862] This architecture does not have kernel memory protection.
[    2.538338] random: fast init done
[    2.569579] Reserved instruction in kernel code[#1]:
[    2.574853] CPU: 0 PID: 1 Comm: init Not tainted 4.9.154 #0
[    2.580631] task: 8382c000 task.stack: 8381e000
[    2.585317] $ 0   : 00000000 804c0000 00000100 c0050000
[    2.590875] $ 4   : 00000000 00000001 00000020 fffc0000
[    2.596390] $ 8   : 01000000 00000800 00000001 b6ba4743
[    2.601814] $12   : f211edb0 00010020 00000000 44c96c1d
[    2.607315] $16   : 83a70000 7fffffff 83a70068 83a70018
[    2.612873] $20   : 83a70ae0 83a76ee4 0001755e 00053616
[    2.618326] $24   : 00000000 523b05d3                  
[    2.623776] $28   : 8381e000 8381fa90 838ef300 801e3824
[    2.629334] Hi    : 00000002
[    2.632363] Lo    : 00000000
[    2.635395] epc   : 801e28cc lzma_main+0x250/0xb74
[    2.640339] ra    : 801e3824 xz_dec_lzma2_run+0x634/0x7fc
[    2.645995] Status: 1000f403	KERNEL EXL IE 
[    2.650445] Cause : 00800028 (ExcCode 0a)
[    2.654619] PrId  : 00019374 (MIPS 24Kc)
[    2.658656] Modules linked in:
[    2.661843] Process init (pid: 1, threadinfo=8381e000, task=8382c000, tls=00000000)
[    2.669915] Stack : 8381fb8c 7fffffff 00000000 7fffffff 83a70000 838efe04 83a76ee8 8038d110
[    2.678626]         00000007 801e3824 00000001 8037a5cc 00000100 801b19a0 839d8800 838efe04
[    2.687492]         00000000 00000000 83a33200 0000005f 0001755e 801e1d6c 00000002 00000000
[    2.696221]         7fffffff 80457f50 00000000 839d88a8 00000000 80377c04 02400000 00000000
[    2.705062]         00000001 8038d0e0 839d8858 8041471c 838efe00 00000000 839d9000 00000000
[    2.713824]         ...
[    2.716363] Call Trace:
[    2.718923] [<801e28cc>] lzma_main+0x250/0xb74
[    2.723624] [<801e3824>] xz_dec_lzma2_run+0x634/0x7fc
[    2.728928] [<801e1d6c>] xz_dec_run+0x3a0/0x908
[    2.733654] [<8017c940>] squashfs_xz_uncompress+0x110/0x1f4
[    2.739465] [<8017c7e8>] squashfs_decompress+0x48/0x80
[    2.744901] [<80178074>] squashfs_read_data+0x234/0x700
[    2.750341] [<8017c224>] squashfs_readpage_block+0x354/0x530
[    2.756204] [<80179f78>] squashfs_readpage+0x610/0x688
[    2.761636] [<800e596c>] __do_page_cache_readahead+0x21c/0x274
[    2.767770] [<800dbd80>] filemap_fault+0x2a0/0x5c4
[    2.772734] [<800fc648>] __do_fault+0x174/0x230
[    2.777478] [<800ffd88>] handle_mm_fault+0x448/0xb2c
[    2.782756] [<8007155c>] __do_page_fault+0x23c/0x468
[    2.787948] [<80065f80>] ret_from_exception+0x0/0x10
[    2.793071] Code: 24850001  00641821  ae050020 <a0620000> 8e030020  8e020024  0043102b  10400002  00000000 
[    2.803404]

Please use "Preformatted text </>" for logs, scripts, configs and general console output.
grafik

Please edit your posting accordingly.

4.9.158 is in master, also broken?

Please note that my uboot version is 2019, and when I changed the uboot to QSDK(1.1.4), all works fine. Strange!!!

OK, it's done, thanks!

4.9.158 panic as well!

After I enable CONFIG_MIPSR2_IRQ_VI option under ath79(dts) target (linux-4.14), it works fine.

Is that in mainline, can you point to it? :slight_smile:

Sorry, I forget to show my patch for ath79 ( dts - linux-4.14 ).

--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -182,6 +182,7 @@ config ATH79
 	select ARCH_HAS_RESET_CONTROLLER
 	select BOOT_RAW
 	select CEVT_R4K
+	select CPU_MIPSR2_IRQ_VI
 	select CSRC_R4K
 	select DMA_NONCOHERENT
 	select GPIOLIB

Applying above patch and execute make kernel_menuconfig to sync your kconfig.
Then your u-boot-master bin can works fine with ath79 image. :smile: