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#2928 - TP-Link TL-WDR3600 v1 on kernel 5.4 boot-loops since change to GCC 8.4.0 #8046
Comments
realmicu: I'm experiencing the same issue on Netgear WNDR4300 (SoC: ar9344). Images compiled with previous version 8.3.0 were OK while 8.4.0 produces invalid code. What worked for me was switching GCC from version 8.4.0 to 9.3.0 :
|
sbrown: Reverting 7000f11c23e23cf11f96 toolchain: Update GCC 8 to version 8.4.0 Fixes the problem on my TP-Link archer a7-v5 |
russell: Fwiw, this is the .config stub I used while bisecting:
|
Hauke: I can reproduce it on a TP-Link TL-WDR4300 v1 with a AR9344. It is happening in the save_dsp() function: The AR9344 says it supports the DSP extension:
I added this function in between: The working assembler for kernel 4.19 looks like this: The crashing assembler for kernel 5.4 looks like this: This looks very similar, Is there some initialization for the DSP extension needed? This commit from Linux 4.20 looks interesting: |
Hauke: I did a git bisect and it breaks since this kernel commit: As this is changing some compiler optimizations I assume this is related to some compiler bug. |
bmork: I can confirm this issue on a Ubiquiti UniFi AP AC Pro, so I don't think there is any reason to limit this bug to a specific device. It's probably target wide. Based on the kernel commit and error location @hauke pointed out, I tried forcibly inlining the dsp_init functions. And that solved the problem for me. See attached patch. Still needs someone to figure out why, and write a proper commit message explaining it all... |
Hauke: Thank you Bjørn Mork that is helpful. We backported the CONFIG_OPTIMIZE_INLINING function already to kernel 4.19, but we did not see the problem there. I did an additional bisect and found that these two changes are also needed to cause this problem: Since this commit the system hangs like this: This hang was fixed in this commit added 3 commits later we see the DSP exception This was both done by manually applying this poach from OpenWrt: My assumption is that the kernel did not handle DSP exceptions correctly before and this was fixed by these patches from Paul. |
Hauke: When I revert this GCC commit it works again: I created a bug report for GCC: I reverted a commit in GCC here: I also see this problem with an unmodified upstream kernel. |
thwalker3: fwiw- 100% confirmed the problem and that reverting to gcc 8.3 works on an Archer C7 v2. Is anyone following through with Jakub in the gcc bugzilla? |
xnoreq: Can confirm as well. Tried flashing master with 5.4 on an Archer C7 v5 last week. Didn't boot. |
ynezz: Hauke probably fixed the issue via https://patchwork.ozlabs.org/project/openwrt/patch/20200702225438.32701-1-hauke@hauke-m.de/ |
russell:
TP-Link TL-WDR3600 v1
Since reboot-12646-gdb70077668 "toolchain: Update GCC 8 to version 8.4.0" and kernel 5.4, WDR3600 boot-loops with the following message:
Starting kernel ...
[ 0.000000] Linux version 5.4.24 (openwrt@hawg) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r12683-8c33debb52)) #0 Sat Mar 21 21:35:45 2020
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] MIPS: machine is TP-Link TL-WDR3600 v1
[ 0.000000] SoC: Atheros AR9344 rev 2
[ 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-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32480
[ 0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 122384K/131072K available (4681K kernel code, 187K rwdata, 1080K rodata, 1212K init, 196K bss, 8688K 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] random: get_random_bytes called from start_kernel+0x32c/0x51c with crng_init=0
[ 0.000000] CPU clock: 560.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6825930166 ns
[ 0.000009] sched_clock: 32 bits at 280MHz, resolution 3ns, wraps every 7669584382ns
[ 0.008305] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[ 0.084927] pid_max: default: 32768 minimum: 301
[ 0.089999] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.097796] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.107070] Kernel panic - not syncing: Unexpected DSP exception
[ 0.113470] Rebooting in 1 seconds..
The text was updated successfully, but these errors were encountered: