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
@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?
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
I don’t see this error on my current 5.4.x branch, but then I have backports from 5.5 added to the base upstream branch which may be the reason. Here’s my dmesg:
VIM2:~ # dmesg | grep dwmac
[ 0.131651] meson8b-dwmac c9410000.ethernet: IRQ eth_wake_irq not found
[ 0.132682] meson8b-dwmac c9410000.ethernet: IRQ eth_lpi not found
[ 0.138856] meson8b-dwmac c9410000.ethernet: PTP uses main clock
[ 0.138863] meson8b-dwmac c9410000.ethernet: no reset control found
[ 0.139337] meson8b-dwmac c9410000.ethernet: User ID: 0x11, Synopsys ID: 0x37
[ 0.139346] meson8b-dwmac c9410000.ethernet: DWMAC1000
[ 0.139351] meson8b-dwmac c9410000.ethernet: DMA HW capability register supported
[ 0.139355] meson8b-dwmac c9410000.ethernet: RX Checksum Offload Engine supported
[ 0.139359] meson8b-dwmac c9410000.ethernet: COE Type 2
[ 0.139362] meson8b-dwmac c9410000.ethernet: TX Checksum insertion supported
[ 0.139366] meson8b-dwmac c9410000.ethernet: Wake-Up On Lan supported
[ 0.139392] meson8b-dwmac c9410000.ethernet: Normal descriptors
[ 0.139396] meson8b-dwmac c9410000.ethernet: Ring mode enabled
[ 0.139400] meson8b-dwmac c9410000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[ 0.139406] meson8b-dwmac c9410000.ethernet: device MAC address 92:c7:b4:58:da:ba
[ 5.644383] meson8b-dwmac c9410000.ethernet eth0: PHY [0.2009087f:00] driver [RTL8211F Gigabit Ethernet]
[ 5.671721] meson8b-dwmac c9410000.ethernet eth0: No Safety Features support found
[ 5.671748] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[ 5.671757] meson8b-dwmac c9410000.ethernet eth0: configuring for phy/rgmii link mode
[ 9.284217] meson8b-dwmac c9410000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
If you feel that patch is the solution you should submit it to the linux-amlogic mailing list so that it can be reviewed and, if accepted, included in the kernel (maybe even backported as a fix). Sending small patches like this upstream is not hard (I’m proof that even non-coding ‘developers’ can do it) and all developers on the Khadas staff need to learn the habit. Upstream contribution is good for the Khadas brand and reputation. Expecting others to do your work for you is not so positive.
@hyphop
Congratulations (and thanks again): your patch works
(for gentoo network scripts in my case).
I wonder though why mainline broke this in between 5.3 and 5.4
Is this a kernel regression or a day-1 dtb issue? And, is it vim2 specific?
Clearly some (different) eth related DMA code in between 5.3 and 5.4 gets (not) called.
I have a s905 minimx-g which has similar dtb section and will check if your patch is needed there as well.