Kernel 6.5 warning of __list_add_valid

38 views
Skip to first unread message

Peter Yoon

unread,
Sep 6, 2023, 6:42:55 AM9/6/23
to android-risc-v
Today I've seen kernel 6.5 update on Starfive upstream tree:

Then tried to merge it with AOSP android-mainline :
And I am getting Kernel warning logs as clipped at bottom, and it failed to boot.

[    1.484121] ------------[ cut here ]------------
[    1.484483] dwmmc_starfive 16020000.mmc: IDMAC supports 32-bit address mode.
[    1.488771] list_add corruption. next->prev should be prev (ffffffff814e5950), but was ffffffd8c007b200. (next=ffffffd8c0f44440).
[    1.495882] dwmmc_starfive 16020000.mmc: Using internal DMA controller.
[    1.507572] WARNING: CPU: 1 PID: 10 at lib/list_debug.c:27 __list_add_valid+0x94/0xb6
[    1.507600] Modules linked in:
[    1.507609] CPU: 1 PID: 10 Comm: kworker/u8:0 Not tainted 6.5.0-gc36b961e4d80 #2
[    1.507620] Hardware name: StarFive VisionFive 2 v1.2A (DT)
[    1.507627] Workqueue: events_unbound deferred_probe_work_func
[    1.507641] epc : __list_add_valid+0x94/0xb6
[    1.507653]  ra : __list_add_valid+0x94/0xb6
[    1.507664] epc : ffffffff8038a434 ra : ffffffff8038a434 sp : ffffffc80006bb50
[    1.507672]  gp : ffffffff81527500 tp : ffffffd8c0180fc0 t0 : 2000000000000000
[    1.507679]  t1 : 000000000000006c t2 : 206464615f747369 s0 : ffffffc80006bb60
[    1.507686]  s1 : ffffffd8c0889840 a0 : 0000000000000075 a1 : 0000000000000018
[    1.507693]  a2 : 0000000000000008 a3 : 0000000000000001 a4 : 0000000000000000
[    1.507699]  a5 : 0000000000000000 a6 : ffffffd8c175b040 a7 : 0000000000000038
[    1.507706]  s2 : ffffffd8c0f44440 s3 : ffffffff814e5880 s4 : ffffffd8c0889978
[    1.507713]  s5 : ffffffd8c0889950 s6 : ffffffd8c010b810 s7 : ffffffff814e5950
[    1.507720]  s8 : ffffffff8002cb6e s9 : ffffffff815292e0 s10: ffffffd8c0050038
[    1.507727]  s11: ffffffd8c00500a8 t3 : ffffffff8153b6ff t4 : ffffffff8153b6ff
[    1.507734]  t5 : ffffffff8153b700 t6 : ffffffff8153b6ff
[    1.507740] status: 0000000200000120 badaddr: 0000000000000000 cause: 0000000000000003
[    1.507748] [<ffffffff8038a434>] __list_add_valid+0x94/0xb6
[    1.507762] [<ffffffff80741954>] starfive_cryp_probe+0x1ae/0x442
[    1.507780] [<ffffffff80561030>] platform_probe+0x4e/0x96
[    1.507792] [<ffffffff8055eb88>] really_probe+0x82/0x210
[    1.507802] [<ffffffff8055ed72>] __driver_probe_device+0x5c/0xd0
[    1.507812] [<ffffffff8055ee12>] driver_probe_device+0x2c/0xb0
[    1.507822] [<ffffffff8055ef04>] __device_attach_driver+0x6e/0x8e
[    1.507832] [<ffffffff8055ceaa>] bus_for_each_drv+0x5c/0xb0
[    1.507849] [<ffffffff8055f1da>] __device_attach+0x9a/0x174
[    1.507859] [<ffffffff8055f42c>] device_initial_probe+0xe/0x16
[    1.507869] [<ffffffff8055ddc4>] bus_probe_device+0x86/0x88
[    1.507883] [<ffffffff8055e95a>] deferred_probe_work_func+0x86/0xbe
[    1.507894] [<ffffffff8002c982>] process_one_work+0x150/0x28c
[    1.507910] [<ffffffff8002cc4e>] worker_thread+0x190/0x312
[    1.507924] [<ffffffff80034096>] kthread+0xda/0xf6
[    1.507937] [<ffffffff80003482>] ret_from_fork+0xa/0x1c
[    1.507949] ---[ end trace 0000000000000000 ]---


Compare arv-6.4_230906.txt & arv-6.5_230906_list_add_valid.txt 
With same Android image and Kernel 6.4 (arv-6.4 tree), it can boot.

Chang Rebecca Swee Fun

unread,
Sep 11, 2023, 3:00:42 AM9/11/23
to android-risc-v
Hi Peter, thanks for finding this. In fact we are currently focusing on kernel 6.1 (ACK) porting. I will check with the kernel enabling team to see if they have bandwidth to help addressing this.

Peter Yoon

unread,
Sep 18, 2023, 6:24:46 AM9/18/23
to android-risc-v
The issue fixed when applying latest version of Starfive upstream tree:

The point was removing following kernel config :
CONFIG_CRYPTO_DEV_JH7110=y

Now default kernel branch of android-risc-v build is arv-6.5 :

mmcblk device number was also changed on kernel 6.5 build :

Peter Yoon

unread,
Sep 18, 2023, 8:44:56 PM9/18/23
to android-risc-v
Patched arv-6.5 kernel tree, then keep using mmc0 for Android boot :

Chang Rebecca Swee Fun

unread,
Sep 19, 2023, 10:14:39 PM9/19/23
to android-risc-v
Hi Peter, may I know the reason to default using mmc0 for android boot? 
Side track: We have branched off Android commom tree v6.1 and maintaining our Starfive patches here:  starfive-tech/aosp-linux at jh7110-android14-6.1-lts (github.com)

Peter Yoon

unread,
Sep 19, 2023, 10:24:40 PM9/19/23
to android-risc-v
(1)  Go to AOSP main branch source :  /system/  and try $grep -r mmcblk0 .
       Then you can find many mmcblk0 hard codings. 

(2) To keep ARV old & new  android & kernel binaries compatible to each other.

Peter Yoon

unread,
Sep 19, 2023, 10:42:46 PM9/19/23
to android-risc-v
Hi Rebecca,

I started looking into following tree,  Big Progress !
https://github.com/starfive-tech/aosp-linux/tree/jh7110-android14-6.1-lts

BTW, please try to keep git commit author if the change is from github.com/android-risc-v/

On Wednesday, September 20, 2023 at 11:14:39 AM UTC+9 rebecc...@starfivetech.com wrote:

Rebecca Chang

unread,
Sep 19, 2023, 10:53:42 PM9/19/23
to Peter Yoon, android-risc-v

Thanks Peter, I have made the correction. Thanks for pointing it out.

We also forked your device and hardware repo for future maintenance and development, but we will keep monitor your branch update.

Do sync with us if you are looking into device/hardware specific optimizations in the future, but for kernel, we will sticked to 6.1 for now.

 

Thanks for your great work in kernel 6.5 as well.

--
You received this message because you are subscribed to a topic in the Google Groups "android-risc-v" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-risc-v/gXkNcBvib3o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-risc-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-risc-v/c5457441-790e-4c27-808e-6da04d42fa64n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages