[BPI-R2] Debian Bullseye image

Hi,

i created a basic debian bullseye image with kernel 5.10.64 and systemd network config.

https://drive.google.com/drive/folders/1oP7jy1KrrIOifvImo2nQ59wx3_9hHkgk?usp=sharing

  • bpi-r2-bullseye_incomplete.img.gz
  • bpi-r2-bullseye_incomplete.img.gz.md5

wan is set to dhcp and lanports are bridged with IPv4 192.168.1.1

tools, firmware and wifi.sh for internal wifi are included (wifi.sh to startup, BSSID: R2_AP0,192.168.10.0/24 dhcp-server enabled)

ssh server is ready and with PermitRootLogin enabled (please disable for productive use)

u-boot 2021-07

user: root PW: bananapi

debug-uart-cable is recommended :slight_smile:

rc.local enabled, pppoe-service prepared (not enabled)

5 Likes

found 2 misconfigurations (will fix in next version):

Zusammenfassung
  • lanports are not assigned to bridge:

create a /etc/systemd/network/lanbr-bind.network with the folowing content:

[Match]
Name=lan0 lan1 lan2 lan3

[Network]
Bridge=lanbr0
  • DHCP-Server wrong configured (used config from my main router without bridge)

/etc/dnsmasq.d/interfaces.conf (disable all other options except for ap0 and add the following)

interface=lanbr0
no-dhcp-interface=eth0
dhcp-range=lanbr0,192.168.1.100,192.168.1.150,255.255.255.0,48h
dhcp-option=lanbr0,3,192.168.1.1

uploaded new version with fixed config.

added also a part from my nft ruleset to enable masquerading and some basic rules. apply with (maybe change path, as i have it in /usr/local/bin because of nft-script i have not added here):

nft -f /usr/local/sbin/ruleset.nft

Thank you much, Frank.

Got it up and running. Needed to because my SD crumbled yesterday.

I’m afraid, I’ll be having questions :smiley:

In fact it seems to be easier than I thought. The root-filesystem was on /dev/md0 (mirrored hdds)

I only pasted root=/dev/md0 and it booted. (with one hell of errors)

Next I pasted “bullseye” in sources list. Apt update, apt upgrade, apt dist-upgrade an there we go!

Once again, you did a great work!

Thomas

No connection between internal and external network

  • forwarding
  • static routes (in your default gateway for net behind your r2)

No connection between internal and external network in r2. in my default gateway for net behind my r2 have no limits. R2 receives PI and responds to the world. R2 distributes IP within its network. The internal network does not see the world. R2 pings with the world, but the internal user cannot ping with the world.

https://www.fw-web.de/dokuwiki/doku.php?id=en/bpi-r2/network/start#routing

i guess your “main-router” does not know subnet behind your r2…

client (on r2 lan) sends packet to r2, r2 forwards to main-router=default-route (if forwarding active), server in internet responds to your main-router and this does not know where your client is (need to send packet to r2 first)

I understand what you want to tell me. How can I fix the R2 subnet? my home subnet is 192.168.1.1. I want to do 192.168.2.1 on R2 I did not find in which file you have the network configuration. /etc/network/interfaces does not have the required information or I don’t know how to change it correctly. Thank you.

Does your client get an ip on r2’s lan-port?

If your home-lan (r2 wan) has already 192.168.1.1/24, you have to change lan-ip and dhcp-server.

Bullseye image does not use /etc/network/interfaces. It uses systemd configuration (/etc/systemd/network). I’m not sure if i used dnsmasq as dhcp-server or if i used systemd here too.

Hi, i just tested this .img and i can’t get internal wifi (MT6625L) to work. Everything else works flawlessly.

there have to be a wifi.sh (if i have not forgot it), either in /usr/local/sbin or in root-dir

else you’ll find it here:

https://github.com/frank-w/BPI-R2-4.14/tree/5.10-main/utils/scripts

if i have forgot it wmt-tools will be missing too

https://github.com/frank-w/BPI-R2-4.14/tree/5.10-main/utils/wmt

1 Like

I got error on line 72. “echo A >/dev/wmtWifi”. i have tryied to do Echo manually but it gives me IO error.

Have you replaced kernel? 5.10 does support mt6625l (5.17/5.18 only compile tested).

Does /dev/wmtWifi exist when you try the echo?

Please make a clean boot and give full log + dmesg

Sorry for the delay.

I am using original kernel packed with .IMG from your GDrive.

/dev/wmtWifi exists. but doest accept echo.

[email protected]:~# echo A >/dev/wmtWifi
bash: echo: write error: Input/output error

Dmesg log:

[  601.999952] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 1813)
[  601.999989] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
[  602.000091] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
[  602.000098] set current consys chipid (0x7623)
[  602.000109] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
[  602.000116] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, 
chipid:0x00007623
[  602.004502] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  602.004522] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  602.004541] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  602.008570] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[  602.008597] [WCN-MOD-INIT][E]do_connectivity_driver_init(58):do common driver init failed, 
ret:-1
[  602.008604] [WLAN-MOD-INIT][I]do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined
[  602.010082] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 1813)
[  605.034505] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
[  605.034773] vcn18: mode operation not allowed
[  605.036879] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(290):Read CONSYS 
chipId(0xfffff093)
[  605.135874] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[  605.135894] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[  605.135904] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[  605.462452] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup
[  610.091602] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 155) installed.
[  611.687466] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 1811)
[  611.687549] [MTK-WIFI] WIFI_write: WIFI_write A
[  611.733567] kalFirmwareImageMapping firmware size 125992
[  612.353361] 0x02 0x08 0x0c 0x00 0x00 0x00 0x00 0x01 0x08 0x00 0x00 0x80 0x90 0x85 0x00 0x00 0x01 0x08 0x10 0x00 0x02 0x01 0x00 0x01 0x00 0x00 0x00 0x80 0x02 0x08 0x0c 0x00 0x02 0x08 0x0c 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x80 0x00 0x8a 0x00 0x00 0x01 0x08 0x10 0x00 0x02 0x01 0x00 0x01 0x04 0x00 0x00 0x80 0x00 0x00 0x00 0x01 0x02 0x08 0x0c 0x00 0x00 0x00 0x00 0x01 0x04 0x00 0x00 0x80 0x00 0x8a 0x00 0x00 0x01 0x04 0x01 0x00 0x04 0x02 0x04 0x06 0x00 0x00 0x04 0x11 0x00 0x00 0x00 0x01 0x04 0x05 0x00 0x03 0xdf 0x0e 0x68 0x01 0x02 0x04 0x02 0x00 0x00 0x03 0x01 0x04 0x01 0x00 0x04 0x02 0x04 0x06 0x00 0x00 0x04 0xdf 0x0e 0x68 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x60 0x00 0x10 0x80 0x00 0x00 0x00 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x60 0x00 0x10 0x80 0x00 0x00 0x00 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x60 0x00 0x10 0x80 0x00 0x00 0x00 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 
[  612.354038] 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x34 0x03 0x00 0x80 0x00 0x00 0x01 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x0c 0x01 0x00 0x80 0x59 0x4d 0x84 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x0c 0x01 0x00 0x80 0x00 0x4d 0x84 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x08 0x10 0x00 0x01 0x01 0x00 0x01 0x34 0x03 0x00 0x80 0x00 0x00 0x00 0x00 0x02 0x08 0x04 0x00 0x00 0x00 0x00 0x01 0x01 0x14 0x01 0x00 0x01 0x02 0x14 0x72 0x02 0x00 0x01 0x00 0x10 0x10 0x51 0x50 0x50 0x4f 0x4f 0x4e 0x4e 0x01 0x10 0x02 0x00 0x01 0x00 0x02 0x10 0x01 0x00 0x00 0x01 0x05 0x02 0x00 0x02 0x02 0x02 0x05 0x02 0x00 0x00 0x02 0x01 0x03 0x01 0x00 0x01 0x02 0x03 0x02 0x00 0x00 0x01 0x02 0x03 0x02 0x00 0x00 0x03 
[  612.354791] [STP-BTM] [W]_stp_btm_handler: get consys dump num packet_num(7)
[  612.465748] 0x7b 0x61 0x73 0x73 0x65 0x72 0x5f 0x74 0x79 0x70 0x65 0x3d 0x34 0x7d 0x3b 0x3b 
[  612.465862] [STPDbg]_stp_dbg_parser_assert_str: parser str is NULL,substring(<ASSERT> )
[  612.465877] [STPDbg]_stp_dbg_parser_assert_str: parser str is NULL,substring(id=)
[  612.465888] [STPDbg]_stp_dbg_parser_assert_str: parser str is NULL,substring(isr=)
[  612.465899] [STPDbg]_stp_dbg_parser_assert_str: parser str is NULL,substring(irq=)
[  612.465909] [STPDbg]_stp_dbg_parser_assert_str: parser str is NULL,substring(rc=)
[  612.465918] [STPDbg]stp_dbg_set_fw_info: passert assert infor fail(-15)
[  612.465939] [STP-BTM] [E]_stp_btm_handler(561):ERROR! set fw issue infor fail(-15),maybe fw 
warm reset...
[  612.465947] g_coredump_mode: 0!
[  612.765563] [STP-BTM] [E]_stp_btm_handler(749):ERROR! polling CTRL STATE fail
[  612.765610] [STP-BTM] [W]_stp_btm_proc: opid id(0x7)(STP_OPID_BTM_PAGED_TRACE) 
error(-1)

This one is strange:

do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not defined

Can you try actual 5.10-main kernel? There i know wifi is working…maybe i missed something in the kernel i packed into the image

Else you can look if there is a module for wifi and wifi.sh maybe miss the loading.

It worked.

I grabbed 5.10.117 and AP0 loaded.

wifi script was okay.

Console output:

[email protected]:~# uname -r
5.10.117-bpi-r2-main
[email protected]:/usr/local/sbin# ./wifi.sh 
wifidev does not exist...create it...
loading wifi driver module
11: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether fe:35:73:e3:6c:2d brd ff:ff:ff:ff:ff:ff permaddr 02:08:22:22:7d:fc
Done, all good, ready to lauch hostapd
hostapd started...set IP
restart dnsmasq...
[email protected]:/usr/local/sbin# iwconfig | grep ap0
ap0       IEEE 802.11  Mode:Master  
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
[email protected]:/usr/local/sbin#
1 Like

So either the module is missing in image or somehow broken…

With knowledge of other kernel working (userspace files are ok) you could try moving to (actual) 5.15 again. Afair wifi in 5.15 was tested…only in 5.18/5.19 is r2-wifi untested yet

I have tryied 5.15.41 and it was broken too.

Thanks for your help.

 Symbol: MTK_COMBO_WIFI [=m]                                                                                       │  
  │ Type  : tristate                                                                                                  │  
  │ Defined at drivers/misc/mediatek/connectivity/Kconfig:217                                                         │  
  │   Prompt: MediaTek combo chip Wi-Fi support                                                                       │  
  │   Depends on: ARM [=y] && MTK_COMBO [=y] && CFG80211 [=m]

the symbol itself is set to module in 5.15 too…strange that this is reported

works on my device…

[email protected]:~# wifi.sh                                                                                                    
wifidev does not exist...create it...                                                                                     
loading wifi driver module                                                                                                
18: ap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000                                     
    link/ether 02:08:22:78:3b:fc brd ff:ff:ff:ff:ff:ff                                                                    
Done, all good, ready to lauch hostapd                                                                                    
hostapd started...set IP                                                                                                  
restart dnsmasq...                                                                                                        
[email protected]:~# uname -a                                                                                                   
Linux bpi-r2 5.15.41-bpi-r2-main #1 SMP Sun Jun 12 14:24:53 CEST 2022 armv7l GNU/Linux                                    
[email protected]:~# 
[email protected]:~# lsmod                                                                                                      
Module                  Size  Used by                                                                                     
bnep                   24576  2                                                                                           
stp_chrdev_bt          24576  0                                                                                           
wlan_gen2            1556480  0                                                                                           
wmt_chrdev_wifi        20480  1 wlan_gen2                                                                                 
xt_CHECKSUM            16384  0                                                                                           
nft_chain_nat          16384  1                                                                                           
xt_MASQUERADE          16384  0                                                                                           
nf_nat                 45056  2 xt_MASQUERADE,nft_chain_nat                                                               
nf_conntrack          139264  2 xt_MASQUERADE,nf_nat                                                                      
nf_defrag_ipv6         20480  1 nf_conntrack                                                                              
nf_defrag_ipv4         16384  1 nf_conntrack                                                                              
nft_counter            16384  0                                                                                           
xt_tcpudp              16384  0                                                                                           
nft_compat             20480  0                                                                                           
nf_tables             212992  3 nft_compat,nft_chain_nat,nft_counter                                                      
nfnetlink              20480  2 nft_compat,nf_tables                                                                      
mt7915e               102400  0                                                                                           
mt76                   81920  1 mt7915e                                                                                   
spidev                 20480  0                                                                                           
mac80211              839680  2 mt76,mt7915e                                                                              
libarc4                16384  1 mac80211                                                                                  
cfg80211              774144  4 mt76,mt7915e,mac80211,wlan_gen2                                                           
lima                   61440  0                                                                                           
gpu_sched              40960  1 lima                                                                                      
spi_mt65xx             20480  0                                                                                           
pwm_mediatek           16384  0                                                                                           
mtk_pmic_keys          16384  0                                                                                           
fuse                  139264  3                                                                                           
ip_tables              24576  0                                                                                           
x_tables               36864  5 ip_tables,nft_compat,xt_tcpudp,xt_MASQUERADE,xt_CHECKSUM

[email protected]:~# zgrep -i 'COMBO' /proc/config.gz                                                                           
CONFIG_MTK_COMBO=y                                                                                                        
# CONFIG_MTK_COMBO_CHIP_MT6620 is not set                                                                                 
# CONFIG_MTK_COMBO_CHIP_MT6628 is not set                                                                                 
# CONFIG_MTK_COMBO_CHIP_MT6630 is not set                                                                                 
# CONFIG_MTK_COMBO_CHIP_CONSYS_6572 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6582 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_8127 is not set                                                                            
CONFIG_MTK_COMBO_CHIP_CONSYS_7623=y                                                                                       
# CONFIG_MTK_COMBO_CHIP_CONSYS_6752 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6592 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_8163 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6735 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6755 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6580 is not set                                                                            
# CONFIG_MTK_COMBO_CHIP_CONSYS_6797 is not set                                                                            
CONFIG_MTK_COMBO_CHIP="CONSYS_7623"                                                                                       
CONFIG_MTK_COMBO_PLAT_PATH=""                                                                                             
CONFIG_MTK_COMBO_COMM=y                                                                                                   
# CONFIG_MTK_COMBO_COMM_UART is not set                                                                                   
# CONFIG_MTK_COMBO_COMM_SDIO is not set                                                                                   
# CONFIG_MTK_COMBO_COMM_NPWR is not set                                                                                   
# CONFIG_MTK_COMBO_COMM_APO is not set                                                                                    
CONFIG_MTK_COMBO_BT=m                                                                                                     
CONFIG_MTK_COMBO_BT_HCI=y                                                                                                 
CONFIG_MTK_COMBO_WIFI=m                                                                                                   
[email protected]:~#

edit: quick tested 5.18-main…there i got a dma page fault (and the “do_wlan_drv_init:CONFIG_MTK_COMBO_WIFI is not define” )

loading wifi driver module                                                                                                
[   61.063908] Internal error: Oops: 2805 [#1] SMP ARM                                                                    
[   61.068798] Modules linked in: wlan_gen2 wmt_chrdev_wifi xt_CHECKSUM nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack ns
[   61.098547] CPU: 0 PID: 504 Comm: mtk_wmtd Tainted: G        W         5.18.0-bpi-r2-main #1                           
[   61.107000] Hardware name: Mediatek Cortex-A7 (Device Tree)                                                            
[   61.112565] PC is at v7_dma_inv_range+0x24/0x54                                                                        
[   61.117101] LR is at __dma_page_dev_to_cpu+0x94/0x134                                                                  
[   61.122152] pc : [<c011e708>]    lr : [<c0118884>]    psr: 20030013                                                    
[   61.128412] sp : e1305d38  ip : 38e38e39  fp : bf3e566c                                                                
[   61.133630] r10: bf401640  r9 : bf401d70  r8 : 00000001                                                                
[   61.138848] r7 : 00000002  r6 : dfff7fdc  r5 : 00000008  r4 : 00000fff                                                 
[   61.145369] r3 : 0000003f  r2 : 00000040  r1 : 40000007  r0 : 3fffffc0                                                 
[   61.151891] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none                                          
[   61.159022] Control: 10c5387d  Table: 856b406a  DAC: 00000051                                                          
[   61.164760] Register r0 information: non-paged memory                                                                  
[   61.169813] Register r1 information: non-paged memory                                                                  
[   61.174860] Register r2 information: non-paged memory                                                                  
[   61.179907] Register r3 information: non-paged memory                                                                  
[   61.184954] Register r4 information: non-paged memory                                                                  
[   61.190000] Register r5 information: non-paged memory                                                                  
[   61.195046] Register r6 information: non-slab/vmalloc memory                                                           
[   61.200703] Register r7 information: non-paged memory                                                                  
[   61.205749] Register r8 information: non-paged memory                                                                  
[   61.210795] Register r9 information: 378-page vmalloc region starting at 0xbf2ed000 allocated at layout_and_allocate+0c
[   61.222362] Register r10 information: 378-page vmalloc region starting at 0xbf2ed000 allocated at layout_and_allocate+c
[   61.234012] Register r11 information: 378-page vmalloc region starting at 0xbf2ed000 allocated at layout_and_allocate+c
[   61.245663] Register r12 information: non-paged memory                                                                 
[   61.250797] Process mtk_wmtd (pid: 504, stack limit = 0x7f8c375f)                                                      
[   61.256888] Stack: (0xe1305d38 to 0xe1306000)                                                                          
[   61.261242] 5d20:                                                       c011e7b8 bf35b8d8                              
[   61.269416] 5d40: c30ca9ec c30ca580 00000008 000186a1 00000001 bf35b8d8 00000000 c2329d40                              
[   61.277589] 5d60: e1305dd8 00000000 01200008 bf401d70 00000008 00000001 00000003 00000089                              
[   61.285763] 5d80: 00a3d6f8 bf3ffc80 00000000 180f0030 ffffffff 88143498 a0030013 00000008                              
[   61.293936] 5da0: e10d1000 e10c9000 00000000 c1303d00 000000a3 00a3d6f8 bf3ffc80 bf31f594                              
[   61.302109] 5dc0: 00000008 00000000 00000003 e1305e14 00000008 e1305e10 00000008 88143498                              
[   61.310283] 5de0: 180f0028 e10c9000 00000001 e10c9000 e10d0588 00000001 0006a000 bf4000e0                              
[   61.318456] 5e00: e150f000 bf2f08b8 e1305e10 bf319b04 0000af00 c000009a c000009a 88143498                              
[   61.326630] 5e20: e10c9000 c000009a e150f050 bf2f0bfc e10c9000 e10d1000 e10d1520 e10c9000                              
[   61.334803] 5e40: 00000000 00000800 bf3ffc80 e150f000 e10fd000 bf2f3bc4 e1305e98 00000000                              
[   61.342976] 5e60: e150f000 e10d1520 c30ca704 bf3c4854 00000000 e10d1000 00000000 00000000                              
[   61.351150] 5e80: c30ca580 e1305ed8 e150f000 88143498 554f4c20 bf4000d8 00000000 c30ca220                              
[   61.359323] 5ea0: c3094800 c30ca580 e10c9000 e1305ed8 c30ca704 bf32ebb0 00004000 00004000                              
[   61.367497] 5ec0: 00000000 00000000 c14d9cdc c07394e4 00000000 00037230 e150f000 c151c370                              
[   61.375670] 5ee0: c1415410 c14da5a4 c074b1d8 88143498 c14da2a4 bf401d70 c151c344 c14da5a4                              
[   61.383843] 5f00: c074b1d8 c1414e20 c14da2a4 c14d9cdc 00000000 bf35a5a4 c151c340 c074b224                              
[   61.392016] 5f20: c14d9cdc c074d530 c074d530 88143498 00000000 c14d970c 00000003 c074888c                              
[   61.400189] 5f40: e1305f3c c075f028 c14da5a4 c14d9c98 c14d9cc0 c151c340 c074d530 c074d6d4                              
[   61.408363] 5f60: c684ec00 c14dac98 c14d9c98 c5e4e980 c597ec00 e1175eb4 c684ec00 c074d57c                              
[   61.416536] 5f80: c14d9c98 00000000 00000000 c014c878 c5e4e980 c014c7b0 00000000 00000000                              
[   61.424709] 5fa0: 00000000 00000000 00000000 c0100148 00000000 00000000 00000000 00000000                              
[   61.432881] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000                              
[   61.441053] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000                              
[   61.449228]  v7_dma_inv_range from __dma_page_dev_to_cpu+0x94/0x134                                                    
[   61.455501]  __dma_page_dev_to_cpu from kalDevPortRead+0x3d0/0x720 [wlan_gen2]                                         
[   61.464588]  kalDevPortRead [wlan_gen2] from nicRxWaitResponse+0x2fc/0x5f0 [wlan_gen2]                                 
[   61.475882]  nicRxWaitResponse [wlan_gen2] from wlanImageSectionDownloadStatus+0xc0/0x29c [wlan_gen2]                  
[   61.488267]  wlanImageSectionDownloadStatus [wlan_gen2] from wlanImageSectionDownload+0x168/0x36c [wlan_gen2]          
[   61.501353]  wlanImageSectionDownload [wlan_gen2] from wlanAdapterStart+0x674/0xf94 [wlan_gen2]                        
[   61.513249]  wlanAdapterStart [wlan_gen2] from wlanProbe+0x318/0xbe8 [wlan_gen2]                                       
[   61.523809]  wlanProbe [wlan_gen2] from HifAhbProbe+0x54/0x88 [wlan_gen2]                                              
[   61.533736]  HifAhbProbe [wlan_gen2] from wmt_func_wifi_on+0x4c/0x150                                                  
[   61.541787]  wmt_func_wifi_on from opfunc_func_on+0xd8/0x31c                                                           
[   61.547454]  opfunc_func_on from wmtd_thread+0x158/0x280                                                               
[   61.552771]  wmtd_thread from kthread+0xc8/0xcc                                                                        
[   61.557307]  kthread from ret_from_fork+0x14/0x2c                                                                      
[   61.562013] Exception stack(0xe1305fb0 to 0xe1305ff8)                                                                  
[   61.567063] 5fa0:                                     00000000 00000000 00000000 00000000                              
[   61.575236] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000                              
[   61.583409] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000                                                
[   61.590022] Code: e2423001 e1100003 e1c00003 f57ff04f (1e070f3e)

[email protected]:~# zgrep -i 'CONFIG_MTK_COMBO_WIFI' /proc/config.gz                                                           
CONFIG_MTK_COMBO_WIFI=m

and i found a warning maybe related to this:

[   61.034771] WARNING: CPU: 0 PID: 504 at include/linux/dma-mapping.h:326 kalDevPortRead+0x670/0x720 [wlan_gen2]         
[   61.036666] mt-wifi 180f0000.wifi: rejecting DMA map of vmalloc memory
....
[   61.038566]  kalDevPortRead [wlan_gen2] from nicRxWaitResponse+0x2fc/0x5f0 [wlan_gen2]                                 
[   61.041690]  nicRxWaitResponse [wlan_gen2] from wlanImageSectionDownloadStatus+0xc0/0x29c [wlan_gen2]                  
[   61.045065]  wlanImageSectionDownloadStatus [wlan_gen2] from wlanImageSectionDownload+0x168/0x36c [wlan_gen2]          

one explanation could be this: https://www.spinics.net/lists/linux-usb/msg226367.html (allocated memory from already virtual memory)

so we are somewhere here: https://github.com/frank-w/BPI-R2-4.14/blob/5.18-main/drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/hif/ahb/ahb.c#L862 as MTK_DMA_BUF_MEMCPY_SUP is disabled in same file above, we land here

@deadmeat / @bitmaster can you help here?

edit: imho problem is in these 2 calls

drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c:3604:		HAL_PORT_RD(prAdapter,
drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic.c:1026:	HAL_PORT_RD(prAdapter,

where kalDevPortRead is called with an already allocated dma-memory, but have no idea how to solve this :frowning: