[BPI-R2] internal Wifi/BT (MT6625L) - Kernel

you missed an “(& …)”

Check my exact line, cut and paste

copy&pasted including the bracket…

now the old error comes back

drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c: In function 'nicRxProcessEventPacket':
drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/include/gl_kal.h:851:53: error: 'memset' writing 6 bytes into a region of size 5 overflows the destination [-Werror=stringop-overflow=]
 #define kalMemZero(pvAddr, u4Size)                  memset(pvAddr, 0, u4Size)
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c:2084:5: note: in expansion of macro 'kalMemZero'
     kalMemZero((void*)(&prBowLinkConnected->aucPeerAddress[0]), MAC_ADDR_LEN); /* @FIXME */

seems to be a gcc7-issue: https://github.com/magnumripper/JohnTheRipper/issues/2533

will now try to build in trusty (my old Ubuntu 14.4)

with gcc 4.8.4:

drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/stp_dbg.o: In function `_genl_register_family_with_ops_grps':
/media/data_ext/bpi-r2-kernel/github/./include/net/genetlink.h:181: undefined reference to `__genl_register_family'
drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.o: In function `mtk_wmt_probe':
/media/data_ext/bpi-r2-kernel/github/drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:131: undefined reference to `pwrap_node_to_regmap'

compile seems to be done…this should be the linker

Darn!

This seems like a compiler problem, I was hoping that doing this cast would make the compiler lose track. The problem is that the structure is actually 6 bytes long but the compiler seems to treat it like a string (len-1).

Yes, this is a completely new issue.

You have to port to 4.16 other files too from 4.4: https://github.com/BPI-SINOVOIP/BPI-R2-bsp/search?utf8=✓&q=pwrap_node_to_regmap&type=

I have done it in 4.14, but it seems i have not added them to 4.16 yet.

Any way to fix gcc7-issue? my linked issue has a different data-type (char-array which is simply resized)

I don’t know, you have to workaround the issue, I think it’s a false-positive, but I don’t have an environment to test GCC7 so I cannot help you.

There are a couple things we can try.

Since I don’t know how UINT_8 is typed in your defines. Try this:

typedef struct _BOW_LINK_CONNECTED {
        CHANNEL_DESC rChannel;
        UINT_8 aucReserved;
        uint8_t aucPeerAddress[6];
} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;

If that doesn’t work, try this:

typedef struct _BOW_LINK_CONNECTED {
        CHANNEL_DESC rChannel;
        UINT_8 aucReserved;
        union {
                unsigned char aucPeerAddress[6];
                uint16_t kludge[3];
        };
} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;

For code-sections select text and use <> button (empty line before and after the codeblock needed)

The linker-errors are fixed…seems to build with gcc 4.8

Fixed indent, thanks

back to ubuntu 18.4, found crosscompiler…

arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/7/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.3.0-16ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/arm-linux-gnueabihf-as --with-ld=/usr/bin/arm-linux-gnueabihf-ld --program-suffix=-7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include
Thread model: posix
gcc version 7.3.0 (Ubuntu/Linaro 7.3.0-16ubuntu3) 

strange, now the message of missing stdarg is coming again…

./include/linux/string.h:9:10: fatal error: stdarg.h: No such file or directory
 #include <stdarg.h>

tried -I/usr/lib/gcc-cross/arm-linux-gnueabihf/7/include/ in CFLAGS, but it seems not working…it looks like exported CFLAGS is ignored…after looking through the huge makefile it seems that the param is now named KCFLAGS…

there are many errors compiling with gcc7…build.log (10,7 KB) => made “make clean” and now i’m on the point of the last error “stringop-overflow=”

@dsiq your first example results in same error, second is a bit different:

drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c: In function 'nicRxProcessEventPacket':
drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/include/gl_kal.h:851:53: error: 'memset' writing 6 bytes into a region of size 4 overflows the destination [-Werror=stringop-overflow=]
 #define kalMemZero(pvAddr, u4Size)                  memset(pvAddr, 0, u4Size)
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c:2084:5: note: in expansion of macro 'kalMemZero'
     kalMemZero(prBowLinkConnected->aucPeerAddress, MAC_ADDR_LEN); /* @FIXME */
     ^~~~~~~~~~

Ah ok, this is a linaro release. Makes sense. I would suggest filing a bug with linaro, they have an online bug tracking system. File it with the original code lines.

Another thing to try is, change unsigned char back to UINT8_T and then do: kalMemZero(prBowLinkConnected->kludge, MAC_ADDR_LEN);

typedef struct _BOW_LINK_CONNECTED {
        CHANNEL_DESC rChannel;
        UINT_8 aucReserved;
        union {
                UINT_8 aucPeerAddress[6];
                uint16_t kludge[3];
        };
} BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;

kalMemZero(prBowLinkConnected->kludge, MAC_ADDR_LEN);   /* @FIXME */


drivers/misc/mediatek/connectivity/wlan/gen2/os/linux/include/gl_kal.h:851:53: error: 'memset' writing 6 bytes into a region of size 4 overflows the destination [-Werror=stringop-overflow=]
 #define kalMemZero(pvAddr, u4Size)                  memset(pvAddr, 0, u4Size)
                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/misc/mediatek/connectivity/wlan/gen2/nic/nic_rx.c:2084:5: note: in expansion of macro 'kalMemZero'
     kalMemZero(prBowLinkConnected->kludge, MAC_ADDR_LEN); /* @FIXME */
     ^~~~~~~~~~

linaro-bug-report (hoping it’s correct): https://bugs.linaro.org/show_bug.cgi?id=3823

apt-get install gcc-5-arm-linux-gnueabihf
update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-7  50
update-alternatives: using /usr/bin/arm-linux-gnueabihf-gcc-7 to provide /usr/bin/arm-linux-gnueabihf-gcc (arm-linux-gnueabihf-gcc) in auto mode
update-alternatives --install /usr/bin/arm-linux-gnueabihf-gcc arm-linux-gnueabihf-gcc /usr/bin/arm-linux-gnueabihf-gcc-5  100
update-alternatives: using /usr/bin/arm-linux-gnueabihf-gcc-5 to provide /usr/bin/arm-linux-gnueabihf-gcc (arm-linux-gnueabihf-gcc) in auto mode

update-alternatives --config arm-linux-gnueabihf-gcc

now i can compile it without this annoying error…not the best way but better than switching between 14.4 and 18.4

since compiled kernel does not boot and no output on terminal i created new branch from 4.16-main which is booting and merged changes to it

but this does not found include/linux/soc/mediatek/pmic_wrap.h which is there

drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:32:36: fatal error: soc/mediatek/pmic_wrap.h: No such file or directory
compilation terminated.

Replace #include <soc/mediatek/pmic_wrap.h> with #include <linux/soc/mediatek/pmic_wrap.h>

Then it should build :wink:

thank you…i have moved the file :wink:

first boot with this kernel:

[   71.845717] Internal error: Oops: 17 [#1] SMP ARM                                                                                                           
[   71.850809] Modules linked in: mt7530 dsa_core bridge mtk_thermal thermal_sys spi_mt65xx mt6577_auxadc pwm_mediatek fuse ipv6                                    
[   71.862117] CPU: 0 PID: 950 Comm: mtk_wmtd Not tainted 4.16.7-bpi-r2-wlan #199                                                                                   
[   71.869293] Hardware name: Mediatek Cortex-A7 (Device Tree)                                                                                                      
[   71.874838] PC is at regulator_set_mode+0x18/0xb4                                                                                                                
[   71.879512] LR is at mtk_wcn_consys_hw_reg_ctrl+0x118/0x68c                                                                                                      
[   71.885045] pc : [<c045d5b0>]    lr : [<c04fbb38>]    psr: 600f0013                                                                                              
[   71.891265] sp : d9f69d60  ip : d9f69d88  fp : d9f69d84                                                                                                          
[   71.896451] r10: 00000001  r9 : 00000000  r8 : 00000001                                                                                                          
[   71.901639] r7 : 00000000  r6 : c0f54b50  r5 : c1036d10  r4 : c0f8fda0                                                                                           
[   71.908119] r3 : f97fbb29  r2 : f97fbb29  r1 : 00000008  r0 : 00000000                                                                                           
[   71.914601] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none                                                                                    
[   71.921685] Control: 10c5387d  Table: 9c68806a  DAC: 00000051                                                                                                    
[   71.927394] Process mtk_wmtd (pid: 950, stack limit = 0x17cc419c)                                                                                                
[   71.933445] Stack: (0xd9f69d60 to 0xd9f6a000)                                                                                                                    
[   71.937775] 9d60: 00000000 c0f8fda0 d9f69dc4 c0f8fda0 c1036d10 c0f54b50 d9f69dc4 d9f69d88                                                                        
[   71.945899] 9d80: c04fbb38 c045d5a4 00000000 00000000 00000000 00000000 00000000 c0f54b50                                                                        
[   71.954024] 9da0: 00000000 d9f69eac c0bfbc58 00000000 00000000 00000001 d9f69ddc d9f69dc8                                                                        
[   71.962150] 9dc0: c04fc260 c04fba2c c0f54b3c c0f901a8 d9f69df4 d9f69de0 c04fe058 c04fc21c                                                                        
[   71.970275] 9de0: c0f04c48 d9f69eb0 d9f69e04 d9f69df8 c04da030 c04fdfc4 d9f69e14 d9f69e08                                                                        
[   71.978401] 9e00: c04da11c c04d9fd4 d9f69e9c d9f69e18 c04d64c0 c04da0e4 c0e9cb80 c014a71c                                                                        
[   71.986526] 9e20: ffffffff c014a71c 00000001 00000000 00000000 c0113370 c0f00018 d9150b80                                                                        
[   71.994651] 9e40: 00000001 dec4f8c0 dc2328c0 c0f08200 df7aab80 d9150b80 00000000 dc2328c0                                                                        
[   72.002777] 9e60: c1036ce0 d9150ee8 d9f69edc f97fbb29 c0925ff4 00000002 c0a3a400 c0ff2f64                                                                        
[   72.010902] 9e80: c0bfbc58 c0c10310 c0bfdbb0 c0ff3c18 d9f69ee4 d9f69ea0 c04d85c8 c04d6470                                                                        
[   72.019028] 9ea0: c0f04c48 c0bfbc9c d9f69ef4 00000000 00000000 f97fbb29 c0ff3514 c0ff2f64                                                                        
[   72.027153] 9ec0: 00000000 c0ff3514 c0ff3c18 c04dd454 c1036ce0 c0ff3530 d9f69f14 d9f69ee8                                                                        
[   72.035279] 9ee0: c04d87cc c04d8538 d9f69f34 d9f69ef8 c04edb7c c0ff3c18 c0ff34ec c0ff3514                                                                        
[   72.043404] 9f00: d9f68000 c04dd454 d9f69f24 d9f69f18 c04d63d8 c04d877c d9f69f34 d9f69f28                                                                        
[   72.051530] 9f20: c04d6424 c04d63b0 d9f69f74 d9f69f38 c04dfbb0 c04d6404 c0c01bd0 c0c01c3c                                                                        
[   72.059655] 9f40: c0c01bf8 00000000 db514fdc db514fc0 dc452140 00000000 d9f68000 c0ff34ec                                                                        
[   72.067781] 9f60: db514fdc db31bd9c d9f69fac d9f69f78 c0148cf0 c04dfa1c 00000000 c04dfa10                                                                        
[   72.075906] 9f80: d9f69fac dc452140 c0148bb0 00000000 00000000 00000000 00000000 00000000                                                                        
[   72.084031] 9fa0: 00000000 d9f69fb0 c01010e8 c0148bbc 00000000 00000000 00000000 00000000                                                                        
[   72.092155] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000                                                                        
[   72.100280] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000                                                                        
[   72.108418] [<c045d5b0>] (regulator_set_mode) from [<c04fbb38>] (mtk_wcn_consys_hw_reg_ctrl+0x118/0x68c)                                                         
[   72.117842] [<c04fbb38>] (mtk_wcn_consys_hw_reg_ctrl) from [<c04fc260>] (mtk_wcn_consys_hw_pwr_on+0x50/0xc4)                                                     
[   72.127609] [<c04fc260>] (mtk_wcn_consys_hw_pwr_on) from [<c04fe058>] (wmt_plat_pwr_ctrl+0xa0/0x124)                                                             
[   72.136687] [<c04fe058>] (wmt_plat_pwr_ctrl) from [<c04da030>] (wmt_ctrl_hw_pwr_on+0x68/0x88)                                                                    
[   72.145160] [<c04da030>] (wmt_ctrl_hw_pwr_on) from [<c04da11c>] (wmt_ctrl+0x44/0xc0)                                                                             
[   72.152854] [<c04da11c>] (wmt_ctrl) from [<c04d64c0>] (wmt_core_ctrl+0x5c/0xe8)                                                                                  
[   72.160118] [<c04d64c0>] (wmt_core_ctrl) from [<c04d85c8>] (opfunc_pwr_on+0x9c/0x244)                                                                            
[   72.167900] [<c04d85c8>] (opfunc_pwr_on) from [<c04d87cc>] (opfunc_func_on+0x5c/0x348)                                                                           
[   72.175767] [<c04d87cc>] (opfunc_func_on) from [<c04d63d8>] (wmt_core_opid_handler+0x34/0x54)                                                                    
[   72.184238] [<c04d63d8>] (wmt_core_opid_handler) from [<c04d6424>] (wmt_core_opid+0x2c/0x6c)                                                                     
[   72.192624] [<c04d6424>] (wmt_core_opid) from [<c04dfbb0>] (wmtd_thread+0x1a0/0x254)                                                                             
[   72.200323] [<c04dfbb0>] (wmtd_thread) from [<c0148cf0>] (kthread+0x140/0x170)                                                                                   
[   72.207504] [<c0148cf0>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)                                                                                   
[   72.214676] Exception stack(0xd9f69fb0 to 0xd9f69ff8)                                                                                                            
[   72.219692] 9fa0:                                     00000000 00000000 00000000 00000000                                                                        
[   72.227817] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000                                                                        
[   72.235941] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000                                                                                          
[   72.242513] Code: e24cb004 e24dd00c e52de004 e8bd4000 (e5904050)                                                                                                 
ep 2                                                                                                                                                                
                                                                                                                                                                    
Messag[   72.248750] ---[ end trace 7979ff367be9ad55 ]---                                                                                                           
e from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                        
 kernel:[   71.845717] Internal error: Oops: 17 [#1] SMP ARM                                                                                                        
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.927394] Process mtk_wmtd (pid: 950, stack limit = 0x17cc419c)                                                                                        
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.933445] Stack: (0xd9f69d60 to 0xd9f6a000)                                                                                                            
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.937775] 9d60: 00000000 c0f8fda0 d9f69dc4 c0f8fda0 c1036d10 c0f54b50 d9f69dc4 d9f69d88                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.945899] 9d80: c04fbb38 c045d5a4 00000000 00000000 00000000 00000000 00000000 c0f54b50                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.954024] 9da0: 00000000 d9f69eac c0bfbc58 00000000 00000000 00000001 d9f69ddc d9f69dc8                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.962150] 9dc0: c04fc260 c04fba2c c0f54b3c c0f901a8 d9f69df4 d9f69de0 c04fe058 c04fc21c                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.970275] 9de0: c0f04c48 d9f69eb0 d9f69e04 d9f69df8 c04da030 c04fdfc4 d9f69e14 d9f69e08                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.978401] 9e00: c04da11c c04d9fd4 d9f69e9c d9f69e18 c04d64c0 c04da0e4 c0e9cb80 c014a71c                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.986526] 9e20: ffffffff c014a71c 00000001 00000000 00000000 c0113370 c0f00018 d9150b80                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   71.994651] 9e40: 00000001 dec4f8c0 dc2328c0 c0f08200 df7aab80 d9150b80 00000000 dc2328c0                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.002777] 9e60: c1036ce0 d9150ee8 d9f69edc f97fbb29 c0925ff4 00000002 c0a3a400 c0ff2f64                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.010902] 9e80: c0bfbc58 c0c10310 c0bfdbb0 c0ff3c18 d9f69ee4 d9f69ea0 c04d85c8 c04d6470                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.019028] 9ea0: c0f04c48 c0bfbc9c d9f69ef4 00000000 00000000 f97fbb29 c0ff3514 c0ff2f64                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.027153] 9ec0: 00000000 c0ff3514 c0ff3c18 c04dd454 c1036ce0 c0ff3530 d9f69f14 d9f69ee8                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.035279] 9ee0: c04d87cc c04d8538 d9f69f34 d9f69ef8 c04edb7c c0ff3c18 c0ff34ec c0ff3514                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.043404] 9f00: d9f68000 c04dd454 d9f69f24 d9f69f18 c04d63d8 c04d877c d9f69f34 d9f69f28                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.051530] 9f20: c04d6424 c04d63b0 d9f69f74 d9f69f38 c04dfbb0 c04d6404 c0c01bd0 c0c01c3c                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.059655] 9f40: c0c01bf8 00000000 db514fdc db514fc0 dc452140 00000000 d9f68000 c0ff34ec                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.067781] 9f60: db514fdc db31bd9c d9f69fac d9f69f78 c0148cf0 c04dfa1c 00000000 c04dfa10                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.075906] 9f80: d9f69fac dc452140 c0148bb0 00000000 00000000 00000000 00000000 00000000                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.084031] 9fa0: 00000000 d9f69fb0 c01010e8 c0148bbc 00000000 00000000 00000000 00000000                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.092155] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.100280] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000                                                                
                                                                                                                                                                    
Message from syslogd@bpi-r2 at Apr 17 20:05:25 ...                                                                                                                  
 kernel:[   72.242513] Code: e24cb004 e24dd00c e52de004 e8bd4000 (e5904050)                                                                                         
+ sleep 5                                                                                                                                                           
+ stp_uart_launcher -p /etc/firmware                                                                                                                                
open device node[   73.856797] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(2)                                                        
 succeed.(Node:/dev/stpwmt, fd:3)                                                                                                                                   
chip id is 0x7623                                                                                                                                                   
chiId:0x7623, setting to property((null))                                                                                                                           
chiId:0x7623                                                                                                                                                        
run SOC chip flow                                                                                                                                                   
create pwr on thread ok                                                                                                                                             
+ echo 0                                                                                                                                                            
[   78.853730] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 924)                                                                                         
[   78.861250] [MTK-WIFI] WIFI_write: WIFI_write 0                                                                                                                  
[   78.861250]                                                                                                                                                      
[   78.867262] [MTK-WIFI] WIFI_write: WIFI is already power off!                                                                                                    
[   78.873000] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 924)                                                                                       
+ sleep 5                                                                                                                                                           
+ echo A                                                                                                                                                            
[   83.884110] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 924)                                                                                         
[   83.891572] [MTK-WIFI] WIFI_write: WIFI_write A                                                                                                                  
[   83.891572]                                                                                                                                                      
[   83.897590] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(3)

You have to update dts file too, for example I don’t see any reference to vcn18 in your arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts

damn…had forgotten to add them…now all nodes should be there, but kernel crashes again

[   81.563249] [<c045d32c>] (regulator_ops_is_valid) from [<c045f334>] (regulator_set_voltage_unlocked+0x44/0x33c)                                                  
[   81.573277] [<c045f334>] (regulator_set_voltage_unlocked) from [<c045f668>] (regulator_set_voltage+0x3c/0x68)                                                    
[   81.583131] [<c045f668>] (regulator_set_voltage) from [<c04fbed4>] (mtk_wcn_consys_hw_reg_ctrl+0x4b4/0x68c)                                                      
[   81.592812] [<c04fbed4>] (mtk_wcn_consys_hw_reg_ctrl) from [<c04fc260>] (mtk_wcn_consys_hw_pwr_on+0x50/0xc4)                                                     
[   81.602578] [<c04fc260>] (mtk_wcn_consys_hw_pwr_on) from [<c04fe058>] (wmt_plat_pwr_ctrl+0xa0/0x124)                                                             
[   81.611656] [<c04fe058>] (wmt_plat_pwr_ctrl) from [<c04da030>] (wmt_ctrl_hw_pwr_on+0x68/0x88)                                                                    
[   81.620128] [<c04da030>] (wmt_ctrl_hw_pwr_on) from [<c04da11c>] (wmt_ctrl+0x44/0xc0)                                                                             
[   81.627823] [<c04da11c>] (wmt_ctrl) from [<c04d64c0>] (wmt_core_ctrl+0x5c/0xe8)                                                                                  
[   81.635087] [<c04d64c0>] (wmt_core_ctrl) from [<c04d85c8>] (opfunc_pwr_on+0x9c/0x244)                                                                            
[   81.642868] [<c04d85c8>] (opfunc_pwr_on) from [<c04d87cc>] (opfunc_func_on+0x5c/0x348)                                                                           
[   81.650735] [<c04d87cc>] (opfunc_func_on) from [<c04d63d8>] (wmt_core_opid_handler+0x34/0x54)                                                                    
[   81.659207] [<c04d63d8>] (wmt_core_opid_handler) from [<c04d6424>] (wmt_core_opid+0x2c/0x6c)                                                                     
[   81.667593] [<c04d6424>] (wmt_core_opid) from [<c04dfbb0>] (wmtd_thread+0x1a0/0x254)                                                                             
[   81.675291] [<c04dfbb0>] (wmtd_thread) from [<c0148cf0>] (kthread+0x140/0x170)                                                                                   
[   81.682472] [<c0148cf0>] (kthread) from [<c01010e8>] (ret_from_fork+0x14/0x2c)     
...
+ stp_uart_launcher -p /etc/firmware                                                                                                                                
open device node[   83.276226] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(2)                                                        
 succeed.(Node:/dev/stpwmt, fd:3)                                                                                                                                   
chip id is 0x7623                                                                                                                                                   
chiId:0x7623, setting to property((null))                                                                                                                           
chiId:0x7623                                                                                                                                                        
run SOC chip flow                                                                                                                                                   
create pwr on thread ok                                                                                                                                             
+ echo 0                                                                                                                                                            
[   88.272752] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 995)                                                                                         
[   88.280310] [MTK-WIFI] WIFI_write: WIFI_write 0                                                                                                                  
[   88.280310]                                                                                                                                                      
[   88.286315] [MTK-WIFI] WIFI_write: WIFI is already power off!                                                                                                    
[   88.292065] [MTK-WIFI] WIFI_close: WIFI_close: major 155 minor 0 (pid 995)                                                                                       
+ sleep 5                                                                                                                                                           
+ echo A                                                                                                                                                            
[   93.303183] [MTK-WIFI] WIFI_open: WIFI_open: major 155 minor 0 (pid 995)                                                                                         
[   93.310706] [MTK-WIFI] WIFI_write: WIFI_write A                                                                                                                  
[   93.310706]                                                                                                                                                      
[   93.316715] [WMT-PLAT][W]wmt_plat_wake_lock_ctrl:WMT-PLAT: wakelock status(1), counter(3)

regulator is available

[21:52] root@bpi-r2:~# ls /sys/kernel/debug/regulator/                          
reg-dummy-regulator-dummy  vcamaf  vcn33_bt    vgp3   vmc    vrtc   vusb        
regulator_summary          vcamd   vcn33_wifi  vibr   vmch   vsim1              
supply_map                 vcamio  vemc3v3     vio18  vpa    vsim2              
va                         vcn18   vgp1        vio28  vproc  vsys               
vcama                      vcn28   vgp2        vm     vrf18  vtcxo      

the other dts-nodes should be here:

[11:47] root@bpi-r2:~# ls /sys/firmware/devicetree/base/                        
adc@11001000                   interrupt-parent  #size-cells                    
#address-cells                 leds              spi@1100a000                   
aliases                        memory            spi@11014000                   
audio-controller@11220000      memory@80000000   spi@11016000                   
btif@1100c000                  mmc@11230000      spi@11017000                   
btif_rx@11000800               mmc@11240000      syscfg@10005000                
btif_tx@11000780               model             syscon@10000000                
chosen                         name              syscon@10001000                
cir@10013000                   nfi@1100d000      syscon@10003000                
compatible                     opp-table         syscon@10209000                
consys@18070000                oscillator@0      syscon@1a000000                
cpus                           oscillator@1      syscon@1b000000                
crypto@1b240000                pinctrl@10005000  thermal@1100b000               
dma-controller@1b007000        pwm@11006000      thermal-zones                  
dummy13m                       pwrap@1000d000    timer                          
ecc@1100e000                   regulator-3p3v    timer@10008000                 
efuse@10206000                 regulator-5v      usb@1a1c0000                   
ethernet@1b100000              reserved-memory   usb@1a240000                   
gpio-keys                      rng@1020f000      usb-phy@1a1c4000               
i2c@11007000                   scpsys@10006000   usb-phy@1a244000               
i2c@11008000                   serial@11002000   watchdog@10007000              
i2c@11009000                   serial@11003000   wifi@180f0000                  
interrupt-controller@10200100  serial@11004000                                  
interrupt-controller@10211000  serial@11005000

Crap, I’m not good at all with regulators, I’m not sure I’m able to help you with this… Could you please attach the full dmesg? (after the crash)

Should i enable more debugging-infos in code (#DEBUG or similar)?