[BPI-R2] Porting 2nd gmac to 4.19

Hi,

i tried porting 2nd gmac from 4.14 to 4.19.

for compare here is the version for 4.14:

it compiles without errors, boots without crash/oops, but it still does not work…i only see eth0 and eth1, but none of the external (USER-) ports in “ip a”

also nothing obviously in dmesg

root@bpi-r2-ubuntu:~# dmesg | grep -i 'dsa\|net'                                                                                                                                   
[    0.195904] NET: Registered protocol family 16                                                                                                                                  
[    0.468627] NET: Registered protocol family 2                                                                                                                                   
[    0.513491] NET: Registered protocol family 1                                                                                                                                   
[    1.068059] drivers/net/ethernet/mediatek/mtk_eth_soc.c:mtk_mdio_init[413]0 237bf14f                                                                                            
[    1.075784] mtk_soc_eth 1b100000.ethernet: generated random MAC address 5e:32:b8:eb:72:9b                                                                                       
[    1.084466] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]                                                              
[    1.095246] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xe14c0000, irq 228                                                                                    
[    1.103682] mtk_soc_eth 1b100000.ethernet: generated random MAC address 12:a6:6c:0e:bd:20                                                                                       
[    1.112250] mtk_soc_eth 1b100000.ethernet: connected mac 1 to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]                                                              
[    1.122983] mtk_soc_eth 1b100000.ethernet eth1: mediatek frame engine at 0xe14c0000, irq 228                                                                                    
[    1.489242] NET: Registered protocol family 17
[    3.678471] NET: Registered protocol family 10

i also wrote to john crispin he will look over it…but maybe anyone here see’s the problem. main challenge was that dsa2.c changes too much for 4.15 (not only functionnames or parameters changed). here i’m unsure if i included new code in right context…

some documentation i used:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/net/dsa/dsa2.c?h=v4.19-rc2

dsa_cpu_parse

net: dsa: setup and teardown ports (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=1d27732f411d57f0168af30be2adb504b8b7749d)

port_apply=> setup

port_unapply => teardown

net: dsa: setup and teardown ports https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=1d27732f411d57f0168af30be2adb504b8b7749d

dsa_ds_parse => dsa_tree_setup_default_cpu

net: dsa: setup and teardown default CPU port https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/net/dsa/dsa2.c?h=v4.19-rc2&id=f070464cf000131928b2c3fd592efd1946610eea

Can anybody help here? I got answer from john crispin that he had not enough time to look over it yet

seems that i got it working with some help of a DSA-Maintainer :slight_smile:

branch is currently based on rc1 but i will import changes to 4.19 if i removed unnecessary stuff (started with printks) and changed mt7530_probe back to mdio_device (platform_device should not be used because it will be dropped in future, but i need to know how to link to mdio-node)

all interfaces are visible, wan is bound to eth1 and lan-ports to eth0…quick-tested wan and lan0 via ping. i can also deactivate the corresponding cpu-port (eth1 for wan or eth0 for lan0) to disable ping…so routing seems correct.

wonder why this is not used

it gets overridden dsa_tree_setup_switches => dsa_port_setup => dsa_user_parse

sets ds->ports[index].upstream = cpu_port_index;

but dp->cpu_dp is not changed again as far as i see, but in slave.c master is changed from cpu_dp.master to ports[x].ethernet so only this seems to be used and cpu_dp ignored

int dsa_slave_create(struct dsa_port *port)
...
	//struct net_device *master = cpu_dp->master;
	struct net_device *master = ds->ports[port->upstream].ethernet;
...

seems to work…hope anybody will test it too

i currently try to move back to mdio-device because the way with platform-device and phandle-linking should not be used anymore

argh…mt7530_probe gets not called again, but diff (dts+mt7530.c) looks good for me

mt7530.diff (9,4 KB)

seems that is caused by size-cells/adress-cells/reg-property in switch-node…changed it and now probe gets called :tada:

had also removed clock-patch and in_atomic (with kernel-hacking) in 4.20-gmac for testing (try to get it mainline)

it seems that it does not have any effect

root@bpi-r2:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  4] local 192.168.0.42 port 5001 connected with 192.168.0.21 port 39930
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   920 MBytes   771 Mbits/sec
^Croot@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.42 port 59860 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   940 Mbits/sec
root@bpi-r2:~# ifdown wan
[ 1445.764386] mt7530 mdio-bus:00 wan: Link is Down
root@bpi-r2:~# [ 1456.498533] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full f
[ 1456.505837] IPv6: ADDRCONF(NETDEV_CHANGE): lan0: link becomes ready

root@bpi-r2:~# ip addr add 192.168.0.15/24 dev lan0                            
root@bpi-r2:~# uname -a
Linux bpi-r2 4.20.0-rc1-bpi-r2-gmac #237 SMP Thu Nov 29 10:06:38 CET 2018 armv7x
root@bpi-r2:~# iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  4] local 192.168.0.15 port 5001 connected with 192.168.0.21 port 54590
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   861 MBytes   721 Mbits/sec
root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.15 port 44502 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.10 GBytes   943 Mbits/sec

seems i have made an error somewhere:

root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.15 port 35150 connected with 192.168.0.21 port 5001
[  102.243908] ------------[ cut here ]------------
[  102.248532] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x278/0x27c
[  102.256768] NETDEV WATCHDOG: eth1 (mtk_soc_eth): transmit queue 0 timed out
[  102.263691] Modules linked in: mtk_thermal thermal_sys mt6577_auxadc spi_mt65xx pwm_mediatek mtk_pmic_keys nvmem_mtk_efuse ip_tabless
[  102.276356] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.4-bpi-r2-testing #231
[  102.283703] Hardware name: Mediatek Cortex-A7 (Device Tree)
[  102.289259] [<c0114ca0>] (unwind_backtrace) from [<c010e9cc>] (show_stack+0x20/0x24)
[  102.296947] [<c010e9cc>] (show_stack) from [<c0bbcff4>] (dump_stack+0x94/0xa8)
[  102.304117] [<c0bbcff4>] (dump_stack) from [<c01283c0>] (__warn+0xf0/0x108)
[  102.311027] [<c01283c0>] (__warn) from [<c0128430>] (warn_slowpath_fmt+0x58/0x74)
[  102.318455] [<c0128430>] (warn_slowpath_fmt) from [<c096b95c>] (dev_watchdog+0x278/0x27c)
[  102.326574] [<c096b95c>] (dev_watchdog) from [<c01a9008>] (call_timer_fn+0x4c/0x194)
[  102.334261] [<c01a9008>] (call_timer_fn) from [<c01a9240>] (expire_timers+0xf0/0x16c)
[  102.342031] [<c01a9240>] (expire_timers) from [<c01a95a8>] (run_timer_softirq+0xf4/0x1ec)
[  102.350146] [<c01a95a8>] (run_timer_softirq) from [<c01023f8>] (__do_softirq+0x148/0x3b4)
[  102.358265] [<c01023f8>] (__do_softirq) from [<c012f188>] (irq_exit+0xdc/0x11c)
[  102.365521] [<c012f188>] (irq_exit) from [<c018b1f8>] (__handle_domain_irq+0x70/0xc4)
[  102.373291] [<c018b1f8>] (__handle_domain_irq) from [<c0102268>] (gic_handle_irq+0x5c/0xa0)
[  102.381577] [<c0102268>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0x90)
[  102.388997] Exception stack(0xc1201ed8 to 0xc1201f20)
[  102.394006] 1ec0:                                                       00000000 00154614
[  102.402121] 1ee0: df59e408 c0121760 ffffe000 c1204c70 c1204cb8 00000001 00000001 c12b8023
[  102.410234] 1f00: c0e51ee4 c1201f34 c1201f38 c1201f28 c010a9f8 c010a9fc 60050013 ffffffff
[  102.418351] [<c0101a0c>] (__irq_svc) from [<c010a9fc>] (arch_cpu_idle+0x48/0x4c)
[  102.425695] [<c010a9fc>] (arch_cpu_idle) from [<c0bd8cd8>] (default_idle_call+0x30/0x3c)
[  102.433726] [<c0bd8cd8>] (default_idle_call) from [<c015cafc>] (do_idle+0xf4/0x164)
[  102.441326] [<c015cafc>] (do_idle) from [<c015ce2c>] (cpu_startup_entry+0x28/0x2c)
[  102.448839] [<c015ce2c>] (cpu_startup_entry) from [<c0bd26ec>] (rest_init+0xc0/0xc4)
[  102.456525] [<c0bd26ec>] (rest_init) from [<c1100ff8>] (start_kernel+0x46c/0x49c)
[  102.463982] ---[ end trace 18e53bf3e74400e7 ]---
[  102.468585] mtk_soc_eth 1b100000.ethernet eth1: transmit timed out
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.04 GBytes   897 Mbits/sec

happens after i made a iperf (client) over wan, set wan down, add ip to lan0 an make iperf again

root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.42 port 36400 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   940 Mbits/sec
root@bpi-r2:~# ifdown wan
[   65.668446] mt7530 mdio-bus:00 wan: Link is Down
root@bpi-r2:~# ip addr add 192.168.0.15/24 dev lan0                                                                                     
root@bpi-r2:~# [   86.884496] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full - flow control off
[   86.891791] IPv6: ADDRCONF(NETDEV_CHANGE): lan0: link becomes ready

root@bpi-r2:~# 
root@bpi-r2:~# iperf -c 192.168.0.21

kernel:

root@bpi-r2:~# uname -a
Linux bpi-r2 4.19.4-bpi-r2-testing #231 SMP Tue Nov 27 18:58:30 CET 2018 armv7l GNU/Linux

reproducable with 4.19, 4.20 but not 4.14 so it seems i made i mistake while porting

sometimes it happens after trying wan again (mtk_soc_eth 1b100000.ethernet eth0: transmit timed out)…tried also with reverted in_atomic and clock-patch (no change)

it seems that some of the ethernet-Patches causes this crash and that they are not needed (as i thought). I applied the patch-series (cherry-picked from 4.20-gmac_test_dsa_only) i’ve posted to mainline-kernel to 4.19…

after testing with 4.20 and now applied to (new) 4.19-gmac and tested again…seems to work without problems

here my tests (iperf over wan,lan0,wan again and lan0 again):

log
root@bpi-r2:~# uname -r
4.19.10-bpi-r2-gmac
root@bpi-r2:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 9a:da:30:8e:aa:52 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 5e:06:08:25:eb:ef brd ff:ff:ff:ff:ff:ff
4: wan@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 5e:06:08:25:eb:ef brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.11/24 brd 192.168.0.255 scope global wan
       valid_lft forever preferred_lft forever
5: lan0@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9a:da:30:8e:aa:52 brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9a:da:30:8e:aa:52 brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 9a:da:30:8e:aa:52 brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 9a:da:30:8e:aa:52 brd ff:ff:ff:ff:ff:ff
9: wan.60@wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 5e:06:08:25:eb:ef brd ff:ff:ff:ff:ff:ff
    inet 192.168.60.1/24 brd 192.168.60.255 scope global wan.60
       valid_lft forever preferred_lft forever
10: lxcbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether 8e:c6:30:ed:4c:43 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.1/24 brd 10.0.3.255 scope global lxcbr0
       valid_lft forever preferred_lft forever
root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.11 port 36498 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   940 Mbits/sec
root@bpi-r2:~# ip link set wan down
[  129.232523] mt7530 mdio-bus:00 wan: Link is Down
root@bpi-r2:~# ip addr add 192.168.0.19/24 dev lan0
root@bpi-r2:~# ip link set lan0 up
[  144.462925] mt7530 mdio-bus:00 lan0: configuring for phy/gmii link mode
root@bpi-r2:~# [  150.717531] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full - flow control off

root@bpi-r2:~# 
root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.19 port 38498 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.10 GBytes   942 Mbits/sec
root@bpi-r2:~# ip link set lan0 down                                                                                                            
[  233.152510] mt7530 mdio-bus:00 lan0: Link is Down
root@bpi-r2:~# 
root@bpi-r2:~# 
root@bpi-r2:~# 
root@bpi-r2:~# ip link set wan up
[  289.553227] mt7530 mdio-bus:00 wan: configuring for phy/gmii link mode
root@bpi-r2:~# [  292.717522] mt7530 mdio-bus:00 wan: Link is Up - 1Gbps/Full - flow control off

root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.11 port 36502 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.09 GBytes   940 Mbits/sec
root@bpi-r2:~# ip link set wan down
[  318.692540] mt7530 mdio-bus:00 wan: Link is Down
root@bpi-r2:~# 
root@bpi-r2:~# ip link set lan0 up
[  352.022970] mt7530 mdio-bus:00 lan0: configuring for phy/gmii link mode
root@bpi-r2:~# [  355.117526] mt7530 mdio-bus:00 lan0: Link is Up - 1Gbps/Full - flow control off

root@bpi-r2:~# iperf -c 192.168.0.21
------------------------------------------------------------
Client connecting to 192.168.0.21, TCP port 5001
TCP window size: 43.8 KByte (default)
------------------------------------------------------------
[  3] local 192.168.0.19 port 38502 connected with 192.168.0.21 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.10 GBytes   942 Mbits/sec
root@bpi-r2:~#

i hope here are some users to test…

fixed crash if cpu-option is not set and want to post it to mainline, but mails got currently blocked on infradead (same as hdmi). contacted postmaster

if anybody here want to try it here is the actual patchset:

contacted andrew and florian how to get further to bring it mainline (they want to avoid dts-option and prefer bridge by user)

Have this problem too

[Tue Aug 13 13:40:01 2019] mtk_soc_eth 1b100000.ethernet eth1: transmit timed out
[Tue Aug 13 13:40:06 2019] mtk_soc_eth 1b100000.ethernet eth1: transmit timed out
[Tue Aug 13 13:40:12 2019] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[Tue Aug 13 13:40:22 2019] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[Tue Aug 13 13:40:32 2019] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[Tue Aug 13 13:40:42 2019] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out

Kernel version is

Linux router.shashilx.local 4.19.66-bpi-r2-main #3 SMP Mon Aug 12 13:07:02 EEST 2019 armv7l GNU/Linux

[Mon Aug 12 20:35:01 2019] ------------[ cut here ]------------
[Mon Aug 12 20:35:01 2019] WARNING: CPU: 1 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x27c/0x280
[Mon Aug 12 20:35:01 2019] NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
[Mon Aug 12 20:35:01 2019] Modules linked in: ppp_mppe xt_multiport ppp_async crc_ccitt ppp_generic slhc nft_chain_route_ipv4 nft_chain_nat_ipv4 nf_nat_ipv4 xt_nat nf_nat nft_counter ipt_REJECT nf_reject_ipv4 xt_TCPMSS xt_state xt_tcpudp xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat nf_tables nfnetlink mt7530 dsa_core phylink bridge mtk_thermal spi_mt65xx thermal_sys pwm_mediatek mtk_pmic_keys mt6577_auxadc nvmem_mtk_efuse ip_tables x_tables ipv6
[Mon Aug 12 20:35:01 2019] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.19.66-bpi-r2-main #3
[Mon Aug 12 20:35:01 2019] Hardware name: Mediatek Cortex-A7 (Device Tree)
[Mon Aug 12 20:35:01 2019] [<c0114784>] (unwind_backtrace) from [<c010e4a4>] (show_stack+0x20/0x24)
[Mon Aug 12 20:35:01 2019] mtk_soc_eth 1b100000.ethernet eth1: transmit timed out
[Mon Aug 12 20:35:01 2019] [<c010e4a4>] (show_stack) from [<c0b625ac>] (dump_stack+0xb8/0xcc)
[Mon Aug 12 20:35:01 2019] [<c0b625ac>] (dump_stack) from [<c012830c>] (__warn+0x104/0x11c)
[Mon Aug 12 20:35:01 2019] [<c012830c>] (__warn) from [<c012837c>] (warn_slowpath_fmt+0x58/0x74)
[Mon Aug 12 20:35:01 2019] [<c012837c>] (warn_slowpath_fmt) from [<c097623c>] (dev_watchdog+0x27c/0x280)
[Mon Aug 12 20:35:01 2019] [<c097623c>] (dev_watchdog) from [<c01a9368>] (call_timer_fn+0x4c/0x194)
[Mon Aug 12 20:35:01 2019] [<c01a9368>] (call_timer_fn) from [<c01a9598>] (expire_timers+0xe8/0x148)
[Mon Aug 12 20:35:01 2019] [<c01a9598>] (expire_timers) from [<c01a98d0>] (run_timer_softirq+0xb8/0x1e4)
[Mon Aug 12 20:35:01 2019] [<c01a98d0>] (run_timer_softirq) from [<c0102398>] (__do_softirq+0xe8/0x384)
[Mon Aug 12 20:35:01 2019] [<c0102398>] (__do_softirq) from [<c012f150>] (irq_exit+0xd8/0x108)
[Mon Aug 12 20:35:01 2019] [<c012f150>] (irq_exit) from [<c018adb8>] (__handle_domain_irq+0x70/0xc4)
[Mon Aug 12 20:35:01 2019] [<c018adb8>] (__handle_domain_irq) from [<c0102268>] (gic_handle_irq+0x5c/0xa0)
[Mon Aug 12 20:35:01 2019] [<c0102268>] (gic_handle_irq) from [<c0101a0c>] (__irq_svc+0x6c/0x90)
[Mon Aug 12 20:35:01 2019] Exception stack(0xde94bf38 to 0xde94bf80)
[Mon Aug 12 20:35:01 2019] bf20:                                                       00000000 0001845c
[Mon Aug 12 20:35:01 2019] bf40: df5ab408 c0121400 de94a000 c1204c70 c1204cb8 00000002 c12b6083 c0e45be8
[Mon Aug 12 20:35:01 2019] bf60: 00000000 de94bf94 de94bf98 de94bf88 c010a680 c010a684 600f0013 ffffffff
[Mon Aug 12 20:35:01 2019] [<c0101a0c>] (__irq_svc) from [<c010a684>] (arch_cpu_idle+0x48/0x4c)
[Mon Aug 12 20:35:01 2019] [<c010a684>] (arch_cpu_idle) from [<c0b7f940>] (default_idle_call+0x30/0x3c)
[Mon Aug 12 20:35:01 2019] [<c0b7f940>] (default_idle_call) from [<c015cd9c>] (do_idle+0xec/0x16c)
[Mon Aug 12 20:35:01 2019] [<c015cd9c>] (do_idle) from [<c015d0dc>] (cpu_startup_entry+0x28/0x2c)
[Mon Aug 12 20:35:01 2019] [<c015d0dc>] (cpu_startup_entry) from [<c0111e80>] (secondary_start_kernel+0x170/0x194)
[Mon Aug 12 20:35:01 2019] [<c0111e80>] (secondary_start_kernel) from [<801026cc>] (0x801026cc)
[Mon Aug 12 20:35:01 2019] ---[ end trace e56451d93e95659f ]---

Don’t do anything special just use it as home router with some services. Have this second time for 24h

You could try revert (or remove by git rebase if revert fails) the changes for 2nd gmac

https://github.com/frank-w/BPI-R2-4.14/commits/4.19-main?after=0a5ab450b676f79a205086cb2c61187b90fc13ba+69&author=frank-w

Starting with net:dsa:

in my tests it lookes like this is caused by additional network-patches (qdma,bql,…). after removing them i did not seen this on 4.19 again (made multiple iperf rounds switching from gmac0 to 1 and back)…hoping phylink gets merged soon and go into next LTS. phylink works better than mainline-driver. i guess this is because of wrong gmac-setup (both need to set to same mode regardless gmac1 does not support trgmii)

Can you tell me how to do this for newbie?

Have pushed a 4.19 branch without the network-patches. Compile it like the other branches using build.sh (importconfig/without param)

https://github.com/frank-w/BPI-R2-4.14/tree/4.19-without2ndgmac

Will try it but of course I will add persistent mac address for wan interface to dts file (I can’t get internet without it). As I understand it’s second gmac?

Without my patches you have only one gmac,so you can add only 1 mac for all ports (maybe change lanports later via ip-command)

No, I mean what we speak in this thread [BPI-R2 new image] debian 10 buster image with Kernel 4.19.62

right, but in the special branch (without second gmac) you have only gmac0 where you can set mac in dts

imho you cannot set mac on dsa-ports (wan,lan0-lan3) in dts

https://github.com/frank-w/BPI-R2-4.14/blob/982128e0b41116e49b6e50e36adc9411784624ac/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts#L200

So I need to set mac for wan in /etc/network/interfaces?

normally it should be enough to set mac in /etc/interfaces for the ports, else change the mac in my dts

@sHAsHiLx have you tried without second gmac?

[BPI-R2] Porting 2nd gmac to 4.19

Yes, but without luck. It’s still lost network ports randomly (can see crash in dmesg if its yet restores network but it’s not always) and this make me crazy. Have tried 4.14 - no errors but very poor pptp vpn and I need these two (network and pptp) work. So just put device on the shelf and wait till someone release stable kernel :wink:

Which crash do you see? Ethx timouts?

Nobody will release a “stable” kernel until problems are reproducable reported :slight_smile:

Btw have you tried phylink? Maybe it fixes your problem (5.3-phylinkX)