[BPI-R2] Kernel Development

What is the current status of 4.14? I have tried to put it together from the threads here but I have been away for awhile and it looks like a lot has changed. I just built 14.14.158 from Frank’s git. I wend thru the included default config and merged the other hardware support (mostly dvb stuff) from /proc/config.gz while the system was running with my mostly working 14.14.56 kernel.

The system boots and things seem unchanged. If i try to run high data rates generated from bpi-r2 side just tons of packet loss still. I had to go right back to my usb-ethernet adapters i had been using.

It has to be something DSA driver related because I don’t have these issues on the USB NIC.

With 4.14.52 (before your working version) second gmac was added,then imho no related changes,except i dropped a openwrt patch that was reported as unstable

You may try 4.19 or 5.4

Thanks for the reply. Any guidance here; I would like to minimize changes seen in userspace as much as possible. It looks like somewhere along the way the network interfaces get different names. 4.19 probably makes the most sense keep the dvb3 interfaces. I probably have a better shot at doing makeoldconfig on 4.19.

Does 4.19 really not support vlans or is the ‘features table’ just old.

I guess it’s working but don’t remember if i had tested it

What do you mean with this?

Done, kernel looks stable (uptime 5+ hrs), but now i have trouble with internal wifi in ap mode. There are 2 states:

  1. client able to connect ap, gets the ip, and even able to ping the router, but no internet/ssh/other services.
  2. Client unable to connect ap (at least for me - the same as after hostapd restart on older kernels)

Over time it switches from 1st state to 2nd, withoun any action from my side.

No additional messages in dmesg. I’ll try to find something in hostapd logs.

boot log dmesg-5.5-merged (39.2 КБ)

For 1: default route/dns set on client,forwarding,default route on r2? for 2: maybe relared to my watchdog cleanup…maybe proc-device is used for reset? I thought this is done by wakelocks…maybe @lexa2 knows more

I cannot download your log :frowning:

I use same config for all kernels. My second 5G card is bridged to same br0 and everything is good there.

Except an issue with mt7612 driver(or another sumsystem, not sure for 100%), the connection on 5G ap halts for 5-20 seconds, after that dmesg shows:

mt76.log (4.3 КБ)

attempt #2: dmesg-5.5-merged (39.2 КБ)

it doesn’t work on this forum :man_shrugging:

https://www.heypasteit.com/clip/0IU67F

Ap0 log looks clean (if the switches to forwarding state not come permanently). I guess the mt76 driver causes this issue…and leave the entire system unstable

Maybe a fix: https://lore.kernel.org/linux-wireless/[email protected]/T/

Ok, i’ll try internal wifi only, and if everything is ok, i’ll try a mt76 fix.

BTW mt76 is pretty stable in 5.3, i’ve not checkd on any diffirice in drivers yet.

And try removing the bridge (or at least ethernet ports from it) if you experience routing-problems

this airtime file is added in 5.5…so 5.4 should not have this issue

Btw. Statistic from my main router:

[08:55] frank@bpi-r2-e:~$ uname -r
4.14.131-bpi-r2-main
[08:56] frank@bpi-r2-e:~$ uptime
 08:56:16 up 90 days, 16:42,  1 user,  load average: 0,29, 0,31, 0,28
[08:56] frank@bpi-r2-e:~$

dmesg clean so far except a oom 2 days ago (only one from one of my vm…i guess my firefox had to much tabs open).

have applied Patch for 5.5-merged, so you can fetch changes and test again

i can ping over ap0 of my test-r2 to my main-r2…works (after adding staticroute to main-r2 and activate forwarding and default-route on test-r2)…

I’ve recompiled kernel with last changes,

Everything seems fine. Once i’ve got wifi related backtrace (likely mt76 driver) on boot(probably hostapd start)

wifi.log (3.7 КБ)

After driver modules reload wifi worked fine, and i didn’t get that messages anymore.

For wifi bridge works great, it’s very convinient for 2 wifi cards.

Now internal wifi works good.

ieee80211_i.h:1439 sta_info_alloc

Was this for internal wifi (did not see it on my quick test) or mt76?

Warning comes with this Patch (only moved) long time ago…

https://patchwork.kernel.org/patch/9702435/

I was wrong about the network interface names thing; looks like they are taking the same names from the dtb.

I took leap and tried to go to your 5.4-main branch. I did make old config from my 4.14 build and I believe merged the other changes from mt7623n_evb_fwu_defconfig.

I have two issues (that I know of). First I can’t seem to get my SATA drive recognized on 5.4. I have verified “CONFIG_SATA_AHCI=y” is set to yes. Any guesses as to what else might be wrong missing?

The other strange on is the lanX ports all work fine, but I can’t seem to get anything to work on the wan port. Its there, I can bring the interface up and down and set an IP on it. If I remove the uplink to the switch and put it back I see the line protocol go up and down in dmesg output. That one has me stumped.

Again thank you so much for all the help and all the hard work you have been putting into kernel support for this board. It would be nearly useless without your efforts.

why not using build.sh importconfig and add your changes? at least for a quick test

i guess SATA needs other option like MTK TPHY or some other not existing in 4.14

maybe AHCI_MTK [=m] or PHY_MTK_TPHY [=y]

maybe you need to load ahci_mtk module

have no idea about the wan-issue except a cabling-problem or maybe mac (do not connect multiple ports to switch without changing mac-address)

I am using build.sh as a basic template to follow of the process; I don’t actually use it because I want to package up the kernel the way slackware ususally does.

My network scripts do set unique macs (well their fixed but each is different) for the ports when they are brought up. In any case I had the wan port initially connected to a DSL modem and it was not working at that point either so I moved it the switch and assigned a static ip to confirm.

It looks like I had AHCI_MTK=y in my config PHY_MTK_TPHY was set to M probably merged in from the other config at some point. I wrote a little loop to go through the configs. These are the lines that still differ at this point. At least some of unmached ones don’t appear to exist in 5.4 any longer if you search for the strings from inside menuconfig. All the other differences look benign. It will be compiling most of the rest of the day here but hopefully this next build works.

|arch/arm/configs/mt7623n_evb_fwu_defconfig (left) .config (right)

CONFIG_LOCALVERSION_AUTO=n
CONFIG_EARLY_PRINTK=y
CONFIG_PAGE_TABLE_ISOLATION=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_OVERLAY_FS=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_IKCONFIG=m CONFIG_IKCONFIG=y
CONFIG_IPV6_TUNNEL=m CONFIG_IPV6_TUNNEL=y
CONFIG_POSIX_MQUEUE=y
CONFIG_POSIX_MQUEUE_SYSCTL=y
CONFIG_SECCOMP_FILTER=y
CONFIG_SECCOMP=y
CONFIG_NF_TABLES=m
CONFIG_NF_CONNTRACK=m CONFIG_NF_CONNTRACK=y
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK_IPV6=m
CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_IPTABLES=y
CONFIG_NF_NAT_MASQUERADE_IPV4=y
CONFIG_NF_NAT_MASQUERADE_IPV6=y
CONFIG_IP6_NF_TARGET_SYNPROXY=m
CONFIG_NETFILTER_XT_MATCH_RECENT=m CONFIG_NETFILTER_XT_MATCH_RECENT=y
CONFIG_NETFILTER_XT_MARK=m CONFIG_NETFILTER_XT_MARK=y
CONFIG_NETFILTER_XT_CONNMARK=m CONFIG_NETFILTER_XT_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_IP_VS=m
CONFIG_NETFILTER_XT_MATCH_IPVS=m
CONFIG_NET_MEDIATEK_HNAT=m
CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_NF_CONNTRACK_FTP=m CONFIG_NF_CONNTRACK_FTP=y
CONFIG_PPP_FILTER=y
CONFIG_PPP_DEFLATE=m
CONFIG_PPP_MPPE=m
CONFIG_AF_KCM=y
CONFIG_CGROUP_BPF=y
CONFIG_CONFIGFS_FS=m CONFIG_CONFIGFS_FS=y
CONFIG_AHCI_MTK=m CONFIG_AHCI_MTK=y
CONFIG_SERIAL_8250_BTIF=y
CONFIG_MEDIA_RC_SUPPORT=y
CONFIG_IR_MTK=y CONFIG_IR_MTK=m
CONFIG_ARM_TIMER_SP804=y
CONFIG_PHY_MT65XX_USB3=y
CONFIG_DEBUG_LL=y
CONFIG_DEBUG_UART_PHYS=0x11002000
CONFIG_DEBUG_UART_VIRT=0xf1002000
CONFIG_CRYPTO_CCM=m CONFIG_CRYPTO_CCM=y
CONFIG_CRYPTO_GCM=m CONFIG_CRYPTO_GCM=y
CONFIG_CRYPTO_ECB=m CONFIG_CRYPTO_ECB=y
CONFIG_CRYPTO_CMAC=m CONFIG_CRYPTO_CMAC=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_MSDOS_FS=m CONFIG_MSDOS_FS=y
CONFIG_NTFS_FS=m CONFIG_NTFS_FS=y
CONFIG_CIFS=m CONFIG_CIFS=y
CONFIG_F2FS_FS=m
CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS=y
CONFIG_RTC_DRV_DS1307=m CONFIG_RTC_DRV_DS1307=y
CONFIG_DRM_ARM=y
CONFIG_SND=y CONFIG_SND=y#alsa
CONFIG_USB_CONFIGFS_SERIAL=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_NET_SCH_CSZ=m
CONFIG_NET_QOS=y
CONFIG_NET_ESTIMATOR=y
CONFIG_NET_CLS_ROUTE=y
CONFIG_NET_CLS_POLICE=y
CONFIG_WLAN_VENDOR_ADMTEK=n
CONFIG_WLAN_VENDOR_ATH=n
CONFIG_WLAN_VENDOR_ATMEL=n
CONFIG_WLAN_VENDOR_BROADCOM=n
CONFIG_WLAN_VENDOR_CISCO=n
CONFIG_WLAN_VENDOR_INTEL=n
CONFIG_WLAN_VENDOR_INTERSIL=n
CONFIG_WLAN_VENDOR_MARVELL=n
CONFIG_WLAN_VENDOR_REALTEK=n
CONFIG_WLAN_VENDOR_RALINK=n
CONFIG_WLAN_VENDOR_RSI=n
CONFIG_WLAN_VENDOR_ST=n
CONFIG_WLAN_VENDOR_TI=n
CONFIG_WLAN_VENDOR_ZYDAS=n
CONFIG_WLAN_VENDOR_QUANTENNA=n
CONFIG_NFS_FS=y CONFIG_NFS_FS=m
CONFIG_NFS_V2=y CONFIG_NFS_V2=m
CONFIG_NFS_V3=y CONFIG_NFS_V3=m
CONFIG_NFS_V4=y CONFIG_NFS_V4=m
CONFIG_NFSD=m CONFIG_NFSD=y
CONFIG_NFSD_FAULT_INJECTION=y
CONFIG_NFS_ACL_SUPPORT=m CONFIG_NFS_ACL_SUPPORT=y
CONFIG_ROOT_NFS=y
CONFIG_POWER_RESET_MT6397_RTC=y

i booted my r2 with uImage_5.4.2-main, and hdd i connected gets recognized…

root@bpi-r2:~# uname -a
Linux bpi-r2 5.4.2-bpi-r2-main #64 SMP Thu Dec 19 17:23:13 CET 2019 armv7l GNU/Linux
root@bpi-r2:~# cat /proc/partitions
major minor  #blocks  name

 179        0   31260672 mmcblk0
 179        1     262144 mmcblk0p1
 179        2    6975488 mmcblk0p2
 179        8    7634944 mmcblk1
   8        0  732574584 sda
   8        1     307200 sda1
   8        2     614400 sda2
   8        3     131072 sda3
   8        4   52068289 sda4
   8        5     358400 sda5
   8        6   15728640 sda6
   8        7  227866624 sda7
   8        8  414515200 sda8
   8        9   20981760 sda9
root@bpi-r2:~# lsmod
Module                  Size  Used by
mtk_pmic_keys          16384  0
mtk_thermal            16384  0
spi_mt65xx             20480  0
pwm_mediatek           16384  0
mt6577_auxadc          16384  0
nvmem_mtk_efuse        16384  0
ip_tables              24576  0
x_tables               32768  1 ip_tables
root@bpi-r2:~#

maybe a powering-issue?

I don’t yet. I did a make clean and I have 5.4.2 recompiling now with the updated config. Its possible that I switching for AHCI_MTK form module to builtin was the issue.

I have to think this is a software issue as doing nothing but switching uEnv.txt back to pointing at my 4.14 kernel image makes the SATA drive work fine.

Once I have new 5.4.2 image to boot, I’ll update.

is your drive powered? do you ise power from 2pin jack between sata connectors?

I am using the 2-pin jack. Do I need to do something to turn power on there with the 5.4 kernel?