Vim2 ethernet problem with - mainline kernel

vim2 broken Ethernet for mainline kernel

NOTE: i have this problem on VIM2 only for all mainline kernels about 2 month
its very strange why nobody ask about this ? :wink:

test image with mainline kernel u can get there https://dl.khadas.com/Firmware/VIM2/Ubuntu/SD_USB/VIM2_Ubuntu-xfce-bionic_Linux-5.3-rc4_arm64_SD-USB_V20190830.7z

u can build last mainline but its have same situations

root@Khadas:~# uname -a
Linux Khadas 5.3.0-rc4 #0.7 SMP PREEMPT Fri Aug 30 12:50:08 CST 2019 aarch64 aarch64 aarch64 GNU/Linux

HOW can reproduce this problem

  1. bootup and login, check ethernet its works
root@Khadas:~# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.110  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::6e06:2d8b:b93e:9ccc  prefixlen 64  scopeid 0x20<link>
        ether be:10:1b:4a:3b:2c  txqueuelen 1000  (Ethernet)
        RX packets 5233  bytes 6585309 (6.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1126  bytes 83055 (83.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 22  

root@Khadas:~# ping 8.8.8.8 -c1
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=50 time=19.2 ms
  1. next step - after next simple commands Ethernet never come again ;(
ifdown eth0
ifup eth0

LOGS:

...
[   71.578058] meson8b-dwmac c9410000.ethernet: Failed to reset the dma
[   71.578835] meson8b-dwmac c9410000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[   71.587857] meson8b-dwmac c9410000.ethernet eth0: stmmac_open: Hw setup failed
RTNETLINK answers: Device or resource busy
Listening on LPF/eth0/be:10:1b:4a:3b:2c
Sending on   LPF/eth0/be:10:1b:4a:3b:2c
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xab15472f)
send_packet: Network is down
dhclient.c:2438: Failed to send 300 byte long packet over eth0 interface.
receive_packet failed on eth0: Network is down
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0xab15472f)
send_packet: Network is down
dhclient.c:2438: Failed to send 300 byte long packet over eth0 interface.
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13 (xid=0xab15472f)
send_packet: Network is down
dhclient.c:2438: Failed to send 300 byte long packet over eth0 interface.
^C

dmesg -c 

[   71.291332] meson8b-dwmac c9410000.ethernet eth0: phy link down rgmii/1Gbps/Full
[   71.291352] meson8b-dwmac c9410000.ethernet eth0: Link is Down
[   71.473224] meson8b-dwmac c9410000.ethernet eth0: PHY [0.2009087f:00] driver [RTL8211F Gigabit Ethernet]
[   71.473239] meson8b-dwmac c9410000.ethernet eth0: phy: setting supported 00,00000000,000062ff advertising 00,00000000,000062ff
[   71.578058] meson8b-dwmac c9410000.ethernet: Failed to reset the dma
[   71.578835] meson8b-dwmac c9410000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[   71.587857] meson8b-dwmac c9410000.ethernet eth0: stmmac_open: Hw setup failed

root@Khadas:~# mii-tool eth0
SIOCGMIIPHY on 'eth0' failed: Invalid argument

full-logs https://gist.github.com/hyphop/4499f3aed67cef3d949fbf7b00aed86b

Hi, wasn’t aware of this issue, could you share the issue on the Linux-amlogic mailing list so other people could check ?

Personally, I never experienced this issue… will have a run next week

@hyphop there is true mainline kernel, and then there’s various branches with lots of extra patches included (like mine). What kernel sources are you using?

for example this one: https://git.kernel.org/torvalds/t/linux-5.4-rc5.tar.gz

but u can use any previous ! its same
https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.3.7.tar.xz

if u know any workable mainline kernel source - plz share - i will happy to check it :wink:

hi @chewitt, :wink:

i have check libreelec image too!
and libreelec is no exception too! have same problems!!!

i think its common Ethernet problem for VIM2 and mainline linux
!!! poor Ethernet driver quality !!!
very interesting why nobody notice this issue ?! i now about this about 2 month already !

we can easy reproduce it

LibreELEC:/ $ uname -a
Linux LibreELEC 5.3.0-rc8 #1 SMP Wed Sep 11 11:52:50 MSK 2019 aarch64 GNU/Linux

LibreELEC:/ $ ping 8.8.8.8 -c1 && echo ok
ok

LibreELEC:/ $ dmesg -c >/dev/null

LibreELEC:/ $ ifconfig eth0 down

## after this ethernet never come again ;)
LibreELEC:/ $ ifconfig eth0 up
> ifconfig: ioctl 0x8914 failed: Device or resource busy

LibreELEC:/ $ dmesg -c
[  562.109408] meson8b-dwmac c9410000.ethernet eth0: PHY [0.2009087f:00] driver [RTL8211F Gigabit Ethernet]
[  562.109498] meson8b-dwmac c9410000.ethernet eth0: phy: setting supported 00,00000000,000062ff advertising 00,00000000,000062ff
[  562.224926] meson8b-dwmac c9410000.ethernet: Failed to reset the dma
[  562.225000] meson8b-dwmac c9410000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed
[  562.225053] meson8b-dwmac c9410000.ethernet eth0: stmmac_open: Hw setup failed

LibreELEC:/ # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network is unreachable

### well-done