[BPI-R64] Kernel-Development

After some poking I got compatible linux-headers, I think:

$ bash build.sh build
...
$ cat include/config/kernel.release
5.4.0-bpi-r64-r64-main

$ LOCALVERSION=-r64-main ./scripts/setlocalversion .
-bpi-r64-r64-main

$ LOCALVERSION=-r64-main ARCH=arm64 CROSS_COMPILE='ccache aarch64-linux-gnu-' make bindeb-pkg

$ ls -lah ../*.deb
-rw-r--r-- 1 ilya ilya  11M фев  2 12:50 ../linux-headers-5.4.0-bpi-r64-r64-main_5.4.0-bpi-r64-r64-main-11_arm64.deb
-rw-r--r-- 1 ilya ilya 4,5M фев  2 12:50 ../linux-image-5.4.0-bpi-r64-r64-main_5.4.0-bpi-r64-r64-main-11_arm64.deb
-rw-r--r-- 1 ilya ilya 1,0M фев  2 12:50 ../linux-libc-dev_5.4.0-bpi-r64-r64-main-11_arm64.deb

imho it works, e.g. https://linux-sunxi.org/Mainline_Kernel_Howto#Specific_Debian_kernel_notes

Then, to make the kernel, use; substituting your cross compiler;:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- deb-pkg

Note: if you want to build, but not start from scratch, the target bindeb-pkg does not do a clean first, whereas deb-pkg does. 

I’ll later try to adapt to banana pi reality.

“works” is relative :wink: it does not create an uImage and path for kernel-image is not the one used by bpi-images (/boot/bananapi/bpi-r*/linux/).

  • for r2 you need 32bit uImage/kernel with appended dtb
  • for r64 you need 32bit uImage with 64bit kernel and with dtb in dtb-folder

if we solve this we can use

ARCH=arm CROSS_COMPILE='ccache arm-linux-gnueabihf-' LOCALVERSION=-main make bindeb-pkg #r2
ARCH=arm64 CROSS_COMPILE='ccache aarch64-linux-gnu-' LOCALVERSION=-r64-main make bindeb-pkg #r64

after importconfig

but for linux-headers i can add it to build.sh/travis, if i found out how to build/upload only the headers-deb

scripts/Makefile.package:

KBUILD_PKG_ROOTCMD ?="fakeroot -u"

deb-pkg:
        $(MAKE) clean
        $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
        $(call cmd,src_tar,$(KDEB_SOURCENAME))
        origversion=$$(dpkg-parsechangelog -SVersion |sed 's/-[^-]*$$//');\
                mv $(KDEB_SOURCENAME).tar.gz ../$(KDEB_SOURCENAME)_$${origversion}.orig.tar.gz
        +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -i.git -us -uc

bindeb-pkg:
        $(CONFIG_SHELL) $(srctree)/scripts/package/mkdebian
        +dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc

maybe we can set KBUILD_PKG_ROOTCMD or DPKG_FLAGS to create source-only or using script before to generate uImage…DPKG_FLAGS seem not to be set anywhere

btw. bindeb-pkg should build only binary package (not source), see help at the end of makefile…but in my test it also creates the source-deb, but deb-pkg makes clean before and seem to create a source tarball. filename ($kernel_headers_packagename) for source-deb is set in the mkdebian script, but i have not found where it was used to create the headers-file…i guess somewhere with the debian/control file, where also the others are listed.

some of the magic (including collecting files for headers-package) seems to be in this script: scripts/package/builddeb

imho adding mkimage and patchs for dtb should be added here. there is also a section about location for image…there is no arm/arm64-part…maybe we can add one using an ENV-Variable to set target-directory

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index c4c580f547ef..5ca7d49e1227 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -70,6 +70,9 @@ um)
 parisc|mips|powerpc)
        installed_image_path="boot/vmlinux-$version"
        ;;
+arm|arm64)
+       installed_image_path="boot/$imagepath/uImage-$version"
+       ;;
 *)
        installed_image_path="boot/vmlinuz-$version"
 esac

but we need to build uImage before…but how

the build itself seems to be done in same file

cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"

we could call dtbs/mkimage after it or passing all options to the existing make

maybe it’s easier to unpack the deb after generation, remove the wrong vmlinux and adding missing files

@frank-w I’ve changed builddeb a little, so one may build linux-image, linux-headers and linux-libc-dev like so

bash build.sh importconfig
bash build.sh build
bash build.sh cryptodev
bash build.sh pack
bash build.sh pack_debs
ls ../*.deb
../linux-headers-5.4.17-bpi-r64-main-packaged_5.4.17-bpi-r64-main-packaged-1_arm64.deb  ../linux-libc-dev_5.4.17-bpi-r64-main-packaged-1_arm64.deb
../linux-image-5.4.17-bpi-r64-main-packaged_5.4.17-bpi-r64-main-packaged-1_arm64.deb
...

I think it is a good idea add the command to https://github.com/frank-w/BPI-R2-4.14/releases

1 Like

Meanwhile, I’ve tried the last commit 2e4b86dfcf329f94ac123175b3eed5231b77bbf6 for my BPI-R64 and it doesn’t work for me because DHCP/WAN=eth1 doesn’t work:

Was in 5.4-r64-main:

[email protected]:~$ ip addr
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 3e:af:11:8b:df:12 brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.1/24 brd 192.168.2.255 scope global eth0
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 5e:7d:b9:2e:95:c4 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.47/24 brd 192.168.1.255 scope global dynamic eth1
       valid_lft 86387sec preferred_lft 86387sec

Now:

[email protected]:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 32:b0:c0:e3:0f:41 brd ff:ff:ff:ff:ff:ff
4: [email protected]: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: [email protected]: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
6: [email protected]: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
7: [email protected]: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
8: [email protected]: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff
9: [email protected]: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether f6:34:86:70:68:93 brd ff:ff:ff:ff:ff:ff

Also wlan disappered.

[email protected]:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)                                                                                                                                                                 
# Include files from /etc/network/interfaces.d:                                                                                                                                                                    
auto lo                                                                                                                                                                                                            
iface lo inet loopback                                                                                                                                                                                             
                                                                                                                                                                                                                   
auto eth0                                                                                                                                                                                                          
#allow-hotplug eth0                                                                                                                                                                                                
iface eth0 inet static                                                                                                                                                                                             
  address 192.168.2.1/24                                                                                                                                                                                          
  #gateway 192.168.1.10                                                                                                                                                                                             
                                                                                                                                                                                                                   
auto eth1                                                                                                                                                                                                         
#allow-hotplug eth1                                                                                                                                                                                                
iface eth1 inet dhcp                                                                                                                                                                                              
                                                                                                                                                                                                                   
source-directory /etc/network/interfaces.d

Good boot: boot-5.4.0-bpi-r64-r64-main.log (32.5 KB)

Bad boot: boot-5.4.17-bpi-r64-main_new.log (14.9 KB)

Any clues?

In 5.4-main i merged dsa driver for r64 and did not merged openwrt phy driver for r64.

You can now work with wan instead of eth1,but need to set eth0 up before…config like for r2. Have you tried working on wan?

Eth is defined in dts only for soc-side (thats why it is visible in ip a),but switchside (port5) is not defined

Just try wan/lanX instead of ethX

For internal wifi…i see a semaphore error on boot,but if i unload module and load again it works in my quick tests…have not found cause of it…[BPI-R64] mt7622 mac80211 WiFi driver

@Ilya_Murav_jov

i have applied your patches to new branch 5.4-deb with changes for r2 (using uImage instead of uImage_nodt). have not tested much due to less time

https://github.com/frank-w/BPI-R2-4.14/tree/5.4-deb

1 Like

Ok, wan works. About lanX, I couldn’t use them with dnsmasq to connect clients to the BPI, do you mean it is not ready now? My configs is:

[email protected]:~$ cat /etc/network/interfaces
auto lo                                                                                                                                                                                                            
iface lo inet loopback                                                                                                                                                                                             
                                                                                                                                                                                                                   
auto eth0                                                                                                                                                                                                          
iface eth0 inet static                                                                                                                                                                                             
  address 192.168.2.1/24                                                                                                                                                                                          
 
                                                                                                                                                                                                                   
auto wan                                                                                                                                                                                                         
iface wan inet dhcp                                                                                                                                                                                              

[email protected]:~$ cat /etc/dnsmasq.d/interfaces.conf 
# netgear has them
min-port=4096
stop-dns-rebind
rebind-localhost-ok
dhcp-lease-max=255
dhcp-authoritative


interface=lan0

dhcp-range=tag:lan0,192.168.2.2,192.168.2.51,255.255.255.0,24h
#$ dnsmasq --help dhcp | grep router | head -1
#  3 router
dhcp-option=tag:lan0,option:router,192.168.2.1

Earlier I used eth0 in dnsmasq’ config and that worked, now I tried lanX instead and failed.

About internal Wifi, yes sometimes reloading works, but in most cases not

[email protected]:~# modprobe -r mt7622 && modprobe mt7622
[40856.429436] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[40856.449097] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[40856.456377] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[40856.474745] cfg80211: failed to load regulatory.db
[40856.586232] mt7622_wmac 18000000.wmac: ASIC revision: 76220010
[40856.593122] mt7622_wmac 18000000.wmac: Invalid MAC address, using random address 56:06:94:79:d5:a9
[40856.604258] mt7622_wmac 18000000.wmac: MAC addr = 56:06:94:79:d5:a9
[40866.830724] mt7622_wmac 18000000.wmac: Message -16 (seq 1) timeout
[40866.837183] mt7622_wmac 18000000.wmac: Failed to get patch semaphore
[40866.844977] mt7622_wmac: probe of 18000000.wmac failed with error -11

The tag: looks wrong

Here is my config for r2…should work for r64 too

http://fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start#dhcp

Have you set them up via interfaces/manual? For dhcp you should set fixed ip to lanport and run dnsmasq on this interface with same subnet and extending range

For wifi…if i understand you right it sounds like timing issue…maybe we can fix it with a delay before semaphore/firmware-load

Hi,

My R64 after some time of working (1-2 days) throws the following, and after that I cannot use ethernet till I restart the system:

[251882.580012] ------------[ cut here ]------------
[251882.580298] NETDEV WATCHDOG: eth0 (mtk_soc_eth): transmit queue 0 timed out
[251882.580669] WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:448 dev_watchdog+0x10c/0x164
[251882.580705] Modules linked in: wireguard ip6_udp_tunnel udp_tunnel ctr aes_generic ccm btmtkuart bluetooth ecdh_generic ecc zram mt7622 mt76 mac80211 libarc4 cfg80211 rfkill libaes nft_masq nft_chain_nat nfs
[251882.581184] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.24-bpi-r64-main #1
[251882.581217] Hardware name: Bananapi BPI-R64 (DT)
[251882.581298] pstate: 80000005 (Nzcv daif -PAN -UAO)
[251882.581351] pc : dev_watchdog+0x10c/0x164
[251882.581401] lr : dev_watchdog+0x10c/0x164
[251882.581431] sp : ffffffc010003d90
[251882.581464] x29: ffffffc010003d90 x28: 0000000000000002 
[251882.581523] x27: ffffffc010003e50 x26: ffffffc01058cb70 
[251882.581580] x25: 0000000000000000 x24: dead000000000122 
[251882.581638] x23: ffffffc010003e50 x22: 0000000000000000 
[251882.581695] x21: ffffff8003056fb8 x20: ffffff8003057000 
[251882.581752] x19: ffffff80030573b8 x18: 000000000000000a 
[251882.581808] x17: 00000000aae019fb x16: 00000000dba08a2f 
[251882.581864] x15: 0000000000000000 x14: ffffffc0109e2221 
[251882.581920] x13: 0000000000020000 x12: ffffffc010947000 
[251882.581977] x11: ffffffc0109e1e43 x10: 0000000000000060 
[251882.582033] x9 : 00000000000001b7 x8 : ffffff803fdb17e0 
[251882.582090] x7 : ffffff803fdb17e0 x6 : 0000000000000001 
[251882.582145] x5 : 0000000000000000 x4 : 0000000000000000 
[251882.582200] x3 : 0000000000000040 x2 : ffffffc01093dcc0 
[251882.582257] x1 : f17ec003da64a800 x0 : 0000000000000000 
[251882.582310] Call trace:
[251882.582370]  dev_watchdog+0x10c/0x164
[251882.582430]  call_timer_fn.isra.31+0x20/0x74
[251882.582482]  __run_timers.part.32+0x1c8/0x1f4
[251882.582532]  run_timer_softirq+0x4c/0x88
[251882.582580]  __do_softirq+0x208/0x250
[251882.582626]  irq_exit+0x7c/0xc0
[251882.582685]  __handle_domain_irq+0x6c/0x98
[251882.582728]  gic_handle_irq+0x70/0xac
[251882.582773]  el1_irq+0xb8/0x180
[251882.582832]  arch_cpu_idle+0x1c/0x2c
[251882.582890]  default_idle_call+0x28/0x2c
[251882.582943]  do_idle+0xd8/0xf4
[251882.582995]  cpu_startup_entry+0x20/0x3c
[251882.583041]  rest_init+0xcc/0xd8
[251882.583088]  arch_call_rest_init+0xc/0x14
[251882.583132]  start_kernel+0x39c/0x3c8
[251882.583203] ---[ end trace d5ebce17defcc6a1 ]---
[251882.583372] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[251882.592130] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[251882.607139] ------------[ cut here ]------------
[251882.607184] refcount_t: underflow; use-after-free.
[251882.607454] WARNING: CPU: 0 PID: 17464 at lib/refcount.c:190 refcount_sub_and_test_checked+0x90/0xcc
[251882.607483] Modules linked in: wireguard ip6_udp_tunnel udp_tunnel ctr aes_generic ccm btmtkuart bluetooth ecdh_generic ecc zram mt7622 mt76 mac80211 libarc4 cfg80211 rfkill libaes nft_masq nft_chain_nat nfs
[251882.607964] CPU: 0 PID: 17464 Comm: kworker/0:0 Tainted: G        W         5.4.24-bpi-r64-main #1
[251882.607997] Hardware name: Bananapi BPI-R64 (DT)
[251882.608069] Workqueue: events mtk_pending_work
[251882.608131] pstate: 80000005 (Nzcv daif -PAN -UAO)
[251882.608197] pc : refcount_sub_and_test_checked+0x90/0xcc
[251882.608259] lr : refcount_sub_and_test_checked+0x90/0xcc
[251882.608289] sp : ffffffc01698bcd0
[251882.608322] x29: ffffffc01698bcd0 x28: 0000000000000000 
[251882.608380] x27: 0000000000000140 x26: 00000000ffffffff 
[251882.608436] x25: 0000000000000000 x24: ffffff803e029a80 
[251882.608493] x23: ffffff803e208000 x22: ffffff803e2087c0 
[251882.608549] x21: 0000000000000001 x20: ffffff803e029a00 
[251882.608605] x19: ffffffc010938000 x18: 0000000000000000 
[251882.608660] x17: 0000000000000000 x16: 0000000000000000 
[251882.608714] x15: 0000000000000000 x14: ffffffc010011000 
[251882.608771] x13: 0000000000020000 x12: ffffffc010947000 
[251882.608827] x11: ffffffc0109e1e41 x10: 0000000000000048 
[251882.608882] x9 : 00000000000001e4 x8 : ffffffc0109e14a0 
[251882.608938] x7 : ffffffc010938588 x6 : ffffff803fdb17d8 
[251882.608992] x5 : 0000000000000006 x4 : 0000000000000001 
[251882.609048] x3 : ffffff803fdb17d8 x2 : ffffff803d966600 
[251882.609134] x1 : f17ec003da64a800 x0 : 0000000000000000 
[251882.609187] Call trace:
[251882.609257]  refcount_sub_and_test_checked+0x90/0xcc
[251882.609318]  refcount_dec_and_test_checked+0x14/0x1c
[251882.609365]  mtk_stop+0x78/0x12c
[251882.609414]  mtk_pending_work+0xd8/0x250
[251882.609464]  process_one_work+0x16c/0x1d8
[251882.609508]  worker_thread+0x1d4/0x264
[251882.609562]  kthread+0xd0/0xe0
[251882.609616]  ret_from_fork+0x10/0x18
[251882.609655] ---[ end trace d5ebce17defcc6a2 ]---
[251882.640941] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[251882.641120] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[251882.641807] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[251882.641958] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[251978.579836] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[251978.582037] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[251978.582435] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[251978.616700] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[251978.616879] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[251978.617466] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[251978.617559] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252068.691822] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252068.700096] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252068.701226] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252068.746232] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252068.746412] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252068.746991] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252068.747083] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252159.571830] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252159.584304] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252159.584628] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252159.634317] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252159.634506] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252159.635064] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252159.635157] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252250.451788] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252250.453015] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252250.453406] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252250.486435] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252250.486615] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252250.487228] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252250.487321] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252346.451775] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252346.453921] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252346.454376] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252346.487521] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252346.489330] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252346.490026] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252346.490121] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252442.451751] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252442.460138] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252442.461357] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252442.506162] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252442.506343] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252442.506960] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252442.507054] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252533.587912] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252533.598484] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252533.598843] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252533.630353] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252533.630530] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252533.631080] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252533.631172] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252623.699731] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252623.701565] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252623.701872] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252623.735333] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252623.735509] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252623.738056] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252623.738160] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx

[email protected]:~# 
[email protected]:~# [252778.579679] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252778.581785] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252778.587203] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252778.619884] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252778.620067] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252778.620602] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252778.620693] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[252938.579660] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[252938.580824] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[252938.581158] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[252938.614281] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[252938.614460] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[252938.614994] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[252938.615087] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx

[email protected]:~# 
[email protected]:~# 
[email protected]:~# �з�ш
[email protected]:~# ping lenta.ru
^C
[email protected]:~# [253087.571640] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[253087.573068] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[253087.573385] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[253087.606326] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[253087.606512] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[253087.607032] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[253087.607124] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[253242.451614] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[253242.452843] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[253242.453159] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[253242.486184] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[253242.486365] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[253242.486917] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[253242.487010] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[253397.587583] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[253397.598019] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[253397.598380] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[253397.630202] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[253397.630379] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[253397.630936] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[253397.631030] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[253546.579549] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[253546.580730] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[253546.587190] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[253546.620911] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[253546.621092] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[253546.621635] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[253546.621727] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[253695.571534] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
[253695.572707] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
[253695.573022] mtk_soc_eth 1b100000.ethernet eth1: Link is Down
[253695.621953] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
[253695.622136] mtk_soc_eth 1b100000.ethernet eth1: configuring for fixed/rgmii link mode
[253695.622675] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
[253695.622767] mtk_soc_eth 1b100000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx

The kernel is 5.4 from @frank-w repo,

[email protected]:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
# need to up it AND before lanX/br0 => manual is just fine for it
iface eth0 inet manual

auto br0
iface br0 inet static
  bridge_ports lan1 lan2 lan3
  address 172.30.1.1/25

auto wan
iface wan inet dhcp

# router0 is renamed from lan0
auto router0
iface router0 inet manual

#auto wlan0
#iface wlan0 inet static
#  address 172.30.1.129/25

What does this error mean?

Hmm, something wrong with

[251882.609187] Call trace:
[251882.609257]  refcount_sub_and_test_checked+0x90/0xcc
[251882.609318]  refcount_dec_and_test_checked+0x14/0x1c
[251882.609365]  mtk_stop+0x78/0x12c
[251882.609414]  mtk_pending_work+0xd8/0x250
[251882.609464]  process_one_work+0x16c/0x1d8
[251882.609508]  worker_thread+0x1d4/0x264
[251882.609562]  kthread+0xd0/0xe0
[251882.609616]  ret_from_fork+0x10/0x18

$ grep -C3 "only shutdown DMA" ./drivers/net/ethernet/mediatek/mtk_eth_soc.c 

        phylink_disconnect_phy(mac->phylink);

        /* only shutdown DMA if this is the last user */
        if (!refcount_dec_and_test(&eth->dma_refcnt)) <======
                return 0;


Afair 5.4 has no second gmac support…so no eth1.

Could you try if network is broken on 5.6-main? I have 3 patches merged that were missing while phylink conversion

Thanks, I’ll try.

By the way, what is gmac and why one doesn’t suffice?

Gmac is the ethernet-lane between soc and switch. There are 2,but gmac #0 on r64 works in sgmii-mode (2.5gbit/s) where the other supports only rgmii (1gbit/s). On r64 basicly 1 is enough for common uses…currently dsa-framework does not support more than 1. So i wonder why your output shows 2…i guess you use the older openwrt driver i had in my repo till 5.4 was released. This had not used dsa-framework and hardwired lan-ports to eth0 and wan to eth1

1 Like

No, I don’t use touch eth1 myself

[email protected]:~# uname -a
Linux bananapir64 5.4.24-bpi-r64-main #1 SMP PREEMPT Thu Mar 5 23:05:33 MSK 2020 aarch64 GNU/Linux

[email protected]:~# ip link list eth1
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 42:0a:f8:7c:c5:3d brd ff:ff:ff:ff:ff:ff

I’ll check it again.

Can you show uname -r? That should be 5.4-rcx

[email protected]:~# uname -r
5.4.24-bpi-r64-main

Most likely the kernel is from https://github.com/frank-w/BPI-R2-4.14/releases

mhm, ok, i see in r64 dts that second gmac is defined but not defined on switch-side (port 5), so it appears in “ip a” but it’s not usable

I am using 5.6-main now, it is ok (now, without wifi=mt7622.ko).

right, have not merged mt7622 wifi-driver to this tree due to missing freetime, but your watchdog-warning/crash was in ethernet-driver ( mtk_soc_eth)

if it is working you can try adding these 2 Patches to 5.4:

05f57ab128ce net: ethernet: mediatek: move mt7623 settings out off the mt7530
903987b837eb net: dsa: mt7530: move mt7623 settings out off the mt7530

currently try to add mt7622, changed Kconfig/Makefile to new folder containing driver, but still old folder is used :thinking:

edit: have found the problem…mt76_new/Kconfig still referred the Kconfig in mt76/* have fixed it and do a test-build and then upload. btw. have added the 2 Patches from rene in 5.4-main

1 Like

You mean 5.6 I think… Ok, but i’ll wait one more day or two to see if it is working more stable than 5.4