Ping latency raises after a while on Phicomm N1 running Armbian 5.67 (4.19 kernel)

Update: The patch mentioned in this post has been merged and I suppose it will be part of Linux 5.0. Phicomm N1’s dtb has also been merged into Linux 5.0. Therefore I suggest you to upgrade the kernel you’re using if you have the problem described in this post, instead of using the dtb I attached at the end of the post. Of course, the dtb should Just Work ™ if you just don’t want to upgrade your kernel.

Not sure if it’s fixed yet, I’m still testing it. But the patch looks promising. Update: I believe it works.

I was led to the patch by sheepman’s message on IRC, through D4T’s post, and finally reached Carlo’s patch. Credits to them, really appreciated.

According to the patch, it’s a BUG in the device tree, which used a wrong IRQ type for RTL8211F. Consequently, (I think) the kernel is losing interrupts and thus not able to process incoming packets timely.

After checking the constants here, I patched the DTB I’m using accordingly:

--- a.dts   2018-01-01 00:00:00.000000000 +0000
+++ b.dts   2018-01-01 00:00:00.000000000 +0000
@@ -844,15 +844,15 @@

        ethernet@c9410000 {
            amlogic,tx-delay-ns = <0x2>;
            clock-names = "stmmaceth", "clkin0", "clkin1";
            clocks = <0xb 0x24 0xb 0x4 0xb 0xf>;
            compatible = "amlogic,meson-gx-dwmac", "amlogic,meson-gxbb-dwmac", "snps,dwmac";
            interrupt-names = "macirq";
-           interrupts = <0x0 0x8 0x1>;
+           interrupts = <0x0 0x8 0x4>;
            phy-handle = <0x1c>;
            phy-mode = "rgmii";
            pinctrl-0 = <0x1b>;
            pinctrl-names = "default";
            reg = <0x0 0xc9410000 0x0 0x10000 0x0 0xc8834540 0x0 0x4>;
            snps,reset-active-low;
            snps,reset-delays-us = <0x0 0x2710 0xf4240>;

The compiled one is also available (with the fix for USB): meson-gxl-s905d-phicomm-n1-usbfix-ethfix.zip.

Leave a Reply

Your email address will not be published. Required fields are marked *