Optimized build for the D-Link DIR-860L

Thanks! Would you mind adding that info to the GitHub PR I linked to (I think you already commented there?).

I don't like polluting closed PR's with not fully related problems. This LZMA ERROR 1 - must RESET board to recover should go to FlySpray, IRC or here to the Forums, IMHO. Ok if there will be a minimal STR and a bisected changeset, the problem could be sent to the mailing list.

So it would be nice to create a minimal diffconfig, find a suspicious commit first.

1 Like

CONFIG_ALL_KMODS=y triggers the lzma error! :boom:

Let's find the first bad commit!


  • OpenWrt SNAPSHOT, r12796-ff6b092121 was good:
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

3: System Boot system code via Flash.
## Booting image at bfc50000 ...
addr:80500000
We have SEAMA, Image Size = 4456388
Verifying Checksum ...
Uncompressing SEAMA linux.lzma ... OK
## Transferring control to Linux (at address 00000000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 4.14.172 (xabolcs@ut1804) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r12798-b51ea43f90)) #0 SMP0
[    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 D-Link DIR-860L B1
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
  • 7daab6286110b95167e291409395494f18edc9dc was bad, but wasn't the first bad :wink:
3 Likes
  • commit 4d979a4d1969b59e462ea4633eeb8c69111261c5 (+ revert of 3ec70052c5d82ffbc8d13e597f2833a1c30bec54 (broke the tree) + applied 95bd6a04b56aaac9270774011c747d0875389dc5 (dma 5.4 fix)) is bad.
  • commit b51ea43f900191bc8ce7411dad39239fac6df4f8 (+revert of 3ec70052c5d82ffbc8d13e597f2833a1c30bec54) is good.

These are exactly the k5.4 commits: Comparing changes

I don't want to bisect into the k5.4 series.

3 Likes

Thanks @xabolcs for chasing down the bug, have you notified the maintainers so the less code savvy people like me can hope for a fix in the foreseeable future.

There is a ramips lzma loader stuff now:

I tried it with manual inserting:

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 8980ff70d4..4f2966d253 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -218,7 +218,8 @@ define Device/dlink_dir-860l-b1
   $(Device/seama)
   BLOCKSIZE := 64k
   SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
-  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
+  LOADER_TYPE := bin
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | loader-kernel | uImage none
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := DIR-860L

... and with the $(Device/uimage-lzma-loader) recipe (which doesn't contain the relocate-kernel) without luck. :frowning:

2 Likes

And now it is enabled for some devices ( mir3g, mir3g v2, mir3p, ... but not for diir-860l yet) through recipe :+1:

https://github.com/openwrt/openwrt/commit/ad19751edc21ae713bd95df6b93be64bd1e0c612

1 Like

I just realized that those commits were irrelevant to DIR-860L. :blush:
Because DIR-860L uses it's own KERNEL commands:

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 6e64fb8bf1..e1b3a518d7 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -218,7 +218,7 @@ define Device/dlink_dir-860l-b1
   $(Device/seama)
   BLOCKSIZE := 64k
   SEAMA_SIGNATURE := wrgac13_dlink.2013gui_dir860lb
-  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma | uImage lzma
+  KERNEL := kernel-bin | append-dtb | relocate-kernel | lzma -d18 | uImage lzma
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := DIR-860L

So it still uses the default dictionary size (-d23). But that dictionary size isn't enough for CONFIG_ALL_KMODS=y in the k5.4 world.
I tried with -d21 (the MT7621 default) but it's not enough, with 19 bit dictionary it boots but unable to find the device tree so it panics:

OF: fdt: No valid device tree found, continuing without
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 
   
3: System Boot system code via Flash.
## Booting image at bfc50000 ...
addr:80500000
We have SEAMA, Image Size = 4915140
Verifying Checksum ...
Uncompressing SEAMA linux.lzma ... OK
## Transferring control to Linux (at address 00000000) ...
## Giving linux memsize in MB, 128

Starting kernel ...

[    0.000000] Linux version 5.4.32 (xabolcs@ut1804) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r12974-75f19deb3a)) #0 SMP Wed Apr 15 02:14:19 2020
[    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
[    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-0x0000000007ffffff]
[    0.000000]   HighMem  empty
[    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] OF: fdt: No valid device tree found, continuing without
[    0.000000] percpu: Embedded 14 pages/cpu s26704 r8192 d22448 u57344
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line:   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=0004050c
[    0.000000] Readback ErrCtl register=0004050c
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 120752K/131072K available (5826K kernel code, 206K rwdata, 1252K rodata, 1280K init, 237K bss, 10320K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/rcu/tree.c:2998 rcu_init+0x55c/0x774
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.32 #0
[    0.000000] Stack : 00000000 800774cc 806b0000 806b6474 80720000 806b643c 806b5590 806efdb4
[    0.000000]         80860000 80701248 80700d83 8064c7e4 00000000 00000001 806efd58 00000000
[    0.000000]         00000000 00000000 808a0000 00000000 00000030 00000027 342e3520 2032332e
[    0.000000]         00000000 00000000 00000000 00000000 00000000 80720000 00000000 807299f0
[    0.000000]         00000009 806451a4 806fe2b0 80700000 00000002 00000010 87ff0000 00000000
[    0.000000]         ...
[    0.000000] Call Trace:
[    0.000000] [<8000b72c>] show_stack+0x30/0x100
[    0.000000] [<8058fac4>] dump_stack+0xa4/0xdc
[    0.000000] [<80028038>] __warn+0xc0/0x10c
[    0.000000] [<800280e0>] warn_slowpath_fmt+0x5c/0xac
[    0.000000] [<807299f0>] rcu_init+0x55c/0x774
[    0.000000] [<80720a7c>] start_kernel+0x2dc/0x55c
[    0.000000] [<80011044>] start_secondary+0xb0/0x3a0
[    0.000000] random: get_random_bytes called from print_oops_end_marker+0x2c/0x64 with crng_init=0
[    0.000000] ---[ end trace 0000000000000000 ]---
[    0.000000] ------------[ cut here ]------------
[    0.000000] WARNING: CPU: 0 PID: 0 at kernel/rcu/tree.c:2999 rcu_init+0x5ac/0x774
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W         5.4.32 #0
[    0.000000] Stack : 00000000 800774cc 806b0000 806b6474 80720000 806b643c 806b5590 806efdb4
[    0.000000]         80860000 80701248 80700d83 8064c7e4 00000000 00000001 806efd58 00000000
[    0.000000]         00000000 00000000 808a0000 00000000 00000030 0000003b 342e3520 2032332e
[    0.000000]         00000000 00000000 00000000 00000000 00000000 80720000 00000000 80729a40
[    0.000000]         00000009 806451a4 806fe2b0 80700000 00000002 00000010 87ff0000 00000000
[    0.000000]         ...
[    0.000000] Call Trace:
[    0.000000] [<8000b72c>] show_stack+0x30/0x100
[    0.000000] [<8058fac4>] dump_stack+0xa4/0xdc
[    0.000000] [<80028038>] __warn+0xc0/0x10c
[    0.000000] [<800280e0>] warn_slowpath_fmt+0x5c/0xac
[    0.000000] [<80729a40>] rcu_init+0x5ac/0x774
[    0.000000] [<80720a7c>] start_kernel+0x2dc/0x55c
[    0.000000] [<80011044>] start_secondary+0xb0/0x3a0
[    0.000000] ---[ end trace f68728a0d3053b52 ]---
[    0.000000] NR_IRQS: 256
[    0.000000] Kernel panic - not syncing: Failed to find mtk,mt7621-sysc node
[    0.000000] Rebooting in 1 seconds..
[    0.000000] Reboot failed -- System halted

As the diff shows, with CONFIG_ALL_KMODS=y, it needs -d18.
Without CONFIG_ALL_KMODS=y, it works flawlessly with the lzma default dictionary size (-d23).

2 Likes

Is anyone running the 5.4 kernel on their DIR-860l? If so, how are you experiences with:

  • Ethernet Speed
  • WiFi Speed
  • WiFi Stability
  • General Stability

Thanks for sharing your experiences :slight_smile:

The DIR860L is unable tot boot the 5.4 kernel due to lzma loader issues, however support recently dropped thanks to @xabolcs!

5.4 has been running without a hitch on my MIR3G so expect a testbuild soon. Only flash if you have a serial connection since it might not boot. Bit of a precaution there, there be possibly bricked routers

Edit: an update to the mt76 driver just landed, so testing a newer new build atm

Edit 2: no funky things overnight on my MIR3G so here is a first test build containing the 5.4 Linux kernel and an updated mt76 driver. Do not install if you don't have a serial connection! Here be bricked routers: r13097
Also, do not keep settings while flashing r13097 since it uses DSA which messes up the switch configuration if you keep your current configuration.

3 Likes

Thank you Bart for the testing build with 5.4 kernel!
Even if we don't have a serial connection, in case of problems with the testing build, is not possible to flash an old working build through Recovery Mode?
Or it exists the risk to damage the recovery mode as well and brick the router?

Recovery mode should work but I cannot check to see if it works since I don't have access to an DIR860L. Better safe then sorry :wink:

ps. do not keep settings while flashing r13097 since it uses DSA which messes up the switch configuration if you keep your current configuration.

2 Likes

I can say that the r13097 build successfully flashed and booted on my spare DIR-860L (with settings reset). I didn't have time to do any testing, so I can't really say much more than that. Thanks for the 5.4 test build.

2 Likes

//off - I've sold my 860l but will monitor the topic out of curiosity. Currently running as a temporary solution Telekom speedport smart 3 as an AP ( 2500 Mbit/s mu-mimo) and an old d-link n-150 as router. Probably will replace the d-link with x86 openwrt, or will get the Xiaomi AC2100 once that become stable enough.

Thanks for the ride everybody! (hopefully the new owner will jump on the topic as well)

1 Like

I confirm, recovery mode is working on DIR-860L: for example it starts automatically after flashing initramfs through TFTP. :upside_down_face:

Just note down: push the reset button through the hole on the bottom of router with a needle or something while powering on the router and wait the orange led to flash! :+1:

1 Like

The new owner is on board. Flashed the last stable last night and so far running well. Got the dlink to replace my buffalo wzr300hp nh2 also running openwrt, which I'll be using as repeater. The only thing I'm missing so far in my setup is having openvpn. Tried installing but it failed even with the force flag. Any chance of having that included in the future?

1 Like

Right now I am using DIR-860L as AP, the main router switched to a home-brew NanoPi R2S running OpenBSD 6.7 beta.

The R2S has 2 gigabits Ethernet ports, one for WAN and the other for LAN with which connected to a switch. The DIR-860L is configured as a node connected to the switch with one of it's LAN port, and WiFi has it's own sub net.

And DIR-860L can access specific servers (like NAS) on the LAN network, without passing through the router.

Unfortunately the 5G Hz WiFi connection is not stable with the latest master branch, which introduced bunch of mt76 driver updates.

The symptom is, the 5G will just disconnected somehow, since I am pretty close to the AP so it's obviously not due to distance.

1 Like

@Enig123 , you could try to reboot and check wifi 5G again.

I had with most of builds ofthis thread the so called "bad boot issue", that made wifi 5G unusable due to very frequent disconnection. After a reboot the router the wifi was stable for all the time until the next reboot.
Bartvz tried to check the "bad boots" logs but we didn't find what was the cause.
In short, try to reboot and it is possible that your wifi will be stable again.

In this weekend I will update to r13097 in order to make some speed and stability tests.

1 Like

That's awesome to hear :smile:

If you have an 1GBit connection and want stuff like shaping I would recommend x86, otherwise something like an ARM based router makes more sense electricity usage-wise

Welcome aboard and enjoy the sometimes slightly bumpy ride :smile:

Not stable as in connections dropping away? Keep in mind that I use a different but very similar device and it has an uptime of 2d 16h 15m 50s and no weirdness 5Ghz wise.
Might be a bad boot as @Axl_Mas posted below which probably has to do with how the wireless interface gets initialized.

Really want some of those nice juicy numbers :smiley:
Laptop with an Intel AX200 WiFi card on 5 GHz:

[ ID] Interval Transfer Bitrate
[ 5] 0.00-60.04 sec 2.07 GBytes 297 Mbits/sec receiver

A bit slower then before where it was in the 320-330 Mbit/s range but no strange dips or similar here.

2.4 Ghz performance is a completely different story. I thought mine was low because I am using an USB LTE dongle and USB 3 causes interference with 2.4 GHz. Have not been able to figure out how to force USB 2 since when I disable USB 3 and enable USB 2, USB on the router does not work anymore. Anyways 2.4 GHz performance with an Redmi Note 8 Pro connected at 72 Mbps:

[ ID] Interval Transfer Bitrate
[ 5] 0.00-61.35 sec 149 MBytes 20.3 Mbits/sec receiver

And that's with dips to 0.00 Mbits/s :confused:

1 Like