RTL88x2BU-Linux-Driver icon indicating copy to clipboard operation
RTL88x2BU-Linux-Driver copied to clipboard

Driver Crashing - Linux 5.17.0-rc8

Open chrisvollorenew opened this issue 2 years ago • 7 comments

Hello,

I am using this driver on Linux 5.17.0-rc8 (arm architecture) with commit at the link below - https://github.com/RinCat/RTL88x2BU-Linux-Driver/commit/5f6ef2ff4f15975fabf17f0fae1e651017f122e9

I am using Yocto to build and my make settings are as follows:

	ARCH=${ARCH} \
	KSRC=${STAGING_KERNEL_BUILDDIR} \
	CONFIG_RTL8822BU=m \
	USER_EXTRA_CFLAGS='-DCONFIG_CONCURRENT_MODE' \

ARCH=arm

Currently using a linux config at least base on sunxi_defconfig I tried to use CONFIG_PLATFORM_ARM_SUNxI for this driver, but did not have good results. Currently using CONFIG_PLATFORM_I386_PC (default).

The driver works, but spews out this crash log when it starts. Any suggestions?

[    9.478474] 88x2bu: loading out-of-tree module taints kernel.
[    9.667857] RTW: module init start
[    9.674403] RTW: rtl88x2bu v5.13.1-20-gbd7c7eb9d.20210702_COEX20210316-18317b7b
[    9.685349] RTW: rtl88x2bu BT-Coex version = COEX20210316-18317b7b
[    9.695236] RTW: [HALMAC]55772M
               HALMAC_MAJOR_VER = 1
               HALMAC_PROTOTYPE_VER = 6
               HALMAC_MINOR_VER = 6
               HALMAC_PATCH_VER = 23
[    9.732221] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[    9.802039] systemd-journald[127]: Received client request to flush runtime journal.
[   10.364144] RTW: HW EFUSE
[   10.369983] RTW: 0x000: 29 81 00 3C  09 00 21 00  B6 04 64 04  00 00 A3 00  
[   10.380298] RTW: 0x010: 2A 2A 2A 2A  2A 2A 2A 2A  2A 2A 2A 02  00 00 FF FF  
[   10.390656] RTW: 0x020: FF FF 24 24  24 24 25 25  25 25 25 25  24 24 24 24  
[   10.400987] RTW: 0x030: 02 00 FF FF  00 FF 10 00  FF FF 2B 2B  2B 2B 2B 2B  
[   10.413692] RTW: 0x040: 2A 2A 2A 2A  2A 02 00 00  FF FF FF FF  28 28 28 28  
[   10.424050] RTW: 0x050: 28 28 28 28  28 28 28 28  28 28 02 00  FF FF 00 FF  
[   10.434462] RTW: 0x060: 10 00 FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.444777] RTW: 0x070: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455164] RTW: 0x080: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455246] RTW: 0x090: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455293] RTW: 0x0A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455339] RTW: 0x0B0: FF FF FF FF  FF FF FF FF  7F 23 1D 00  FF FF FF FF  
[   10.455385] RTW: 0x0C0: FF 21 00 10  00 00 00 00  00 FF 03 FF  FF FF FF FF  
[   10.455430] RTW: 0x0D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455476] RTW: 0x0E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455521] RTW: 0x0F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455567] RTW: 0x100: DA 0B 2C B8  E7 67 82 60  1D 9D DA 7E  AE 09 03 52  
[   10.455613] RTW: 0x110: 65 61 6C 74  65 6B 0E 03  38 30 32 2E  31 31 61 63  
[   10.455659] RTW: 0x120: 20 4E 49 43  08 03 31 32  33 34 35 36  FF FF FF FF  
[   10.455705] RTW: 0x130: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455750] RTW: 0x140: 33 0A 1F 01  00 00 21 0F  FF FF FF FF  FF FF FF FF  
[   10.455796] RTW: 0x150: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455842] RTW: 0x160: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455888] RTW: 0x170: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455933] RTW: 0x180: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.455979] RTW: 0x190: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456025] RTW: 0x1A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456071] RTW: 0x1B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456116] RTW: 0x1C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456162] RTW: 0x1D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456208] RTW: 0x1E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456253] RTW: 0x1F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456298] RTW: 0x200: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456343] RTW: 0x210: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456389] RTW: 0x220: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456435] RTW: 0x230: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456481] RTW: 0x240: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456526] RTW: 0x250: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456574] RTW: 0x260: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456620] RTW: 0x270: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456666] RTW: 0x280: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456711] RTW: 0x290: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456758] RTW: 0x2A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456804] RTW: 0x2B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456849] RTW: 0x2C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456896] RTW: 0x2D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456942] RTW: 0x2E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.456988] RTW: 0x2F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[   10.457055] RTW: hal_com_config_channel_plan chplan:0x7F
[   10.457086] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[   10.505968] RTW: [HALMAC][ALWAYS]shall R reg twice!!
[   10.648391] RTW: WARN Invalid rate 0x0 in MRateToHwRate
[   10.922527] RTW: WARN Invalid rate 0x0 in MRateToHwRate
[   10.928895] RTW: WARN Invalid rate 0x0 in MRateToHwRate
[   10.939917] RTW: WARN Invalid rate 0x0 in MRateToHwRate
[   10.972481] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[   10.982358] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[   10.989231] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[   10.996004] RTW: [RF_PATH] ver_id.RF_TYPE:RF_2T2R
[   11.001818] RTW: [RF_PATH] HALSPEC's rf_reg_trx_path_bmp:0x33, rf_reg_path_avail_num:2, max_tx_cnt:2
[   11.012154] RTW: [RF_PATH] PG's trx_path_bmp:0x00, max_tx_cnt:0
[   11.019263] RTW: [RF_PATH] Registry's trx_path_bmp:0x00, tx_path_lmt:0, rx_path_lmt:0
[   11.028364] RTW: [RF_PATH] HALDATA's trx_path_bmp:0x33, max_tx_cnt:2
[   11.036032] RTW: [RF_PATH] HALDATA's rf_type:RF_2T2R, NumTotalRFPath:2
[   11.043941] RTW: [TRX_Nss] HALSPEC - tx_nss:2, rx_nss:2
[   11.050615] RTW: [TRX_Nss] Registry - tx_nss:0, rx_nss:0
[   11.057398] RTW: [TRX_Nss] HALDATA - tx_nss:2, rx_nss:2
[   11.064213] RTW: txpath=0x3, rxpath=0x3
[   11.069624] RTW: txpath_1ss:0x1, num:1
[   11.074930] RTW: txpath_2ss:0x3, num:2
[   11.081655] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1
[   11.102678] RTW: rtw_ndev_init(wlan0) if1 mac_addr=60:1d:9d:da:7e:ae
[   11.115361] RTW: rtw_ndev_init(wlan1) if2 mac_addr=62:1d:9d:da:7e:ae
[   11.125671] usbcore: registered new interface driver rtl88x2bu
[   11.133640] RTW: module init ret=0
[   12.867591] random: crng init done
[   12.872945] random: 6 urandom warning(s) missed due to ratelimiting
[   15.313588] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Quota mode: disabled.
[   15.408930] EXT4-fs (mmcblk0p5): mounted filesystem with ordered data mode. Quota mode: disabled.
[   15.420117] ext4 filesystem being mounted at /mnt/mmcblk0p5 supports timestamps until 2038 (0x7fffffff)
[   15.675066] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Quota mode: disabled.
[   15.688501] ext4 filesystem being mounted at /mnt/mmcblk0p7 supports timestamps until 2038 (0x7fffffff)
[   26.699000] rtl88x2bu 1-1:1.2 wlan0: Current addr:  60 1d 9d da 7e ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.712569] rtl88x2bu 1-1:1.2 wlan0: Expected addr: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   26.726119] ------------[ cut here ]------------
[   26.730901] WARNING: CPU: 2 PID: 1216 at net/core/dev_addr_lists.c:517 dev_addr_check+0xfc/0x12c
[   26.739965] netdevice: wlan0: Incorrect netdev->dev_addr
[   26.745421] Modules linked in: 88x2bu(O)
[   26.749537] CPU: 2 PID: 1216 Comm: ip Tainted: G           O      5.17.0-rc8 #1
[   26.757008] Hardware name: Allwinner sun8i Family
[   26.761822]  unwind_backtrace from show_stack+0x10/0x14
[   26.767193]  show_stack from dump_stack_lvl+0x40/0x4c
[   26.772382]  dump_stack_lvl from __warn+0xb0/0xd8
[   26.777203]  __warn from warn_slowpath_fmt+0x90/0xb8
[   26.782327]  warn_slowpath_fmt from dev_addr_check+0xfc/0x12c
[   26.788236]  dev_addr_check from __dev_open+0x34/0x190
[   26.793517]  __dev_open from __dev_change_flags+0x17c/0x1f4
[   26.799216]  __dev_change_flags from dev_change_flags+0x14/0x44
[   26.805256]  dev_change_flags from do_setlink+0x26c/0xacc
[   26.810765]  do_setlink from __rtnl_newlink+0x5a8/0x8bc
[   26.816098]  __rtnl_newlink from rtnl_newlink+0x40/0x60
[   26.821425]  rtnl_newlink from rtnetlink_rcv_msg+0x240/0x2b8
[   26.827198]  rtnetlink_rcv_msg from netlink_rcv_skb+0xb4/0x10c
[   26.833169]  netlink_rcv_skb from netlink_unicast+0x1f8/0x2d0
[   26.839055]  netlink_unicast from netlink_sendmsg+0x1c4/0x43c
[   26.844926]  netlink_sendmsg from ____sys_sendmsg+0x194/0x220
[   26.850787]  ____sys_sendmsg from ___sys_sendmsg+0xa0/0xcc
[   26.856382]  ___sys_sendmsg from sys_sendmsg+0x4c/0x88
[   26.861659]  sys_sendmsg from ret_fast_syscall+0x0/0x54
[   26.867039] Exception stack(0xc53adfa8 to 0xc53adff0)
[   26.872233] dfa0:                   00000000 00000001 00000004 bef557a0 00000000 00000000
[   26.880569] dfc0: 00000000 00000001 b6f00550 00000128 60f6c544 00000000 004bccb4 004bccb4
[   26.888897] dfe0: 00000128 bef55740 b6e21cff b6da1346
[   26.894115] ---[ end trace 0000000000000000 ]---
[   26.922965] RTW: [HALMAC][ALWAYS]shall R reg twice!!
[   28.074198] start_addr=(0x20000), end_addr=(0x40000), buffer_size=(0x20000), smp_number_max=(16384)
[   28.098508] RTW: ERROR rtl8822b_c2h_handler_no_io: C2H(9) enqueue FAIL!
[   28.521715] RTW: WARN _beamforming_leave: 00:00:00:00:00:00 is neither beamforming ee or er!!
[   28.530475] RTW: ERROR Free disconnecting network of scanned_queue failed due to pwlan == NULL

[   28.549256] rtl88x2bu 1-1:1.2 wlan1: Current addr:  62 1d 9d da 7e ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   28.562856] rtl88x2bu 1-1:1.2 wlan1: Expected addr: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   28.576349] ------------[ cut here ]------------
[   28.585416] WARNING: CPU: 2 PID: 1283 at net/core/dev_addr_lists.c:517 dev_addr_check+0xfc/0x12c
[   28.598815] netdevice: wlan1: Incorrect netdev->dev_addr
[   28.608626] Modules linked in: 88x2bu(O)
[   28.616818] CPU: 2 PID: 1283 Comm: ip Tainted: G        W  O      5.17.0-rc8 #1
[   28.628339] Hardware name: Allwinner sun8i Family
[   28.637093]  unwind_backtrace from show_stack+0x10/0x14
[   28.646276]  show_stack from dump_stack_lvl+0x40/0x4c
[   28.655182]  dump_stack_lvl from __warn+0xb0/0xd8
[   28.663675]  __warn from warn_slowpath_fmt+0x90/0xb8
[   28.672469]  warn_slowpath_fmt from dev_addr_check+0xfc/0x12c
[   28.682074]  dev_addr_check from __dev_open+0x34/0x190
[   28.691068]  __dev_open from __dev_change_flags+0x17c/0x1f4
[   28.700491]  __dev_change_flags from dev_change_flags+0x14/0x44
[   28.710290]  dev_change_flags from do_setlink+0x26c/0xacc
[   28.719588]  do_setlink from __rtnl_newlink+0x5a8/0x8bc
[   28.728730]  __rtnl_newlink from rtnl_newlink+0x40/0x60
[   28.737857]  rtnl_newlink from rtnetlink_rcv_msg+0x240/0x2b8
[   28.747374]  rtnetlink_rcv_msg from netlink_rcv_skb+0xb4/0x10c
[   28.757029]  netlink_rcv_skb from netlink_unicast+0x1f8/0x2d0
[   28.766584]  netlink_unicast from netlink_sendmsg+0x1c4/0x43c
[   28.776131]  netlink_sendmsg from ____sys_sendmsg+0x194/0x220
[   28.785692]  ____sys_sendmsg from ___sys_sendmsg+0xa0/0xcc
[   28.794968]  ___sys_sendmsg from sys_sendmsg+0x4c/0x88
[   28.803865]  sys_sendmsg from ret_fast_syscall+0x0/0x54
[   28.812825] Exception stack(0xd0991fa8 to 0xd0991ff0)
[   28.821636] 1fa0:                   00000000 00000001 00000004 beb9b7a0 00000000 00000000
[   28.833702] 1fc0: 00000000 00000001 b6f31550 00000128 60f6c546 00000000 0052ccb4 0052ccb4
[   28.845832] 1fe0: 00000128 beb9b740 b6e52cff b6dd2346
[   28.854941] ---[ end trace 0000000000000000 ]---
[   28.974730] rtl88x2bu 1-1:1.2 wlan0: Current addr:  60 1d 9d da 7e ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   28.992443] rtl88x2bu 1-1:1.2 wlan0: Expected addr: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   29.010009] ------------[ cut here ]------------
[   29.018808] WARNING: CPU: 3 PID: 1288 at net/core/dev_addr_lists.c:517 dev_addr_check+0xfc/0x12c
[   29.031915] netdevice: wlan0: Incorrect netdev->dev_addr
[   29.041503] Modules linked in: 88x2bu(O)
[   29.049743] CPU: 3 PID: 1288 Comm: hostapd Tainted: G        W  O      5.17.0-rc8 #1
[   29.061813] Hardware name: Allwinner sun8i Family
[   29.070762]  unwind_backtrace from show_stack+0x10/0x14
[   29.080189]  show_stack from dump_stack_lvl+0x40/0x4c
[   29.089386]  dump_stack_lvl from __warn+0xb0/0xd8
[   29.098137]  __warn from warn_slowpath_fmt+0x90/0xb8
[   29.107043]  warn_slowpath_fmt from dev_addr_check+0xfc/0x12c
[   29.116591]  dev_addr_check from __dev_open+0x34/0x190
[   29.125596]  __dev_open from __dev_change_flags+0x17c/0x1f4
[   29.134974]  __dev_change_flags from dev_change_flags+0x14/0x44
[   29.144653]  dev_change_flags from devinet_ioctl+0x78c/0x7bc
[   29.153988]  devinet_ioctl from inet_ioctl+0x18c/0x21c
[   29.162814]  inet_ioctl from sock_ioctl+0x47c/0x568
[   29.171388]  sock_ioctl from sys_ioctl+0x53c/0xbe4
[   29.179823]  sys_ioctl from ret_fast_syscall+0x0/0x54
[   29.188491] Exception stack(0xd09adfa8 to 0xd09adff0)
[   29.197108] dfa0:                   be8959ac 00000000 00000008 00008914 be8959ac 00001003
[   29.208926] dfc0: be8959ac 00000000 00556d20 00000036 00000008 00555450 00000000 00000000
[   29.220800] dfe0: 0054fbcc be89599c 004eb4b3 b6c3b408
[   29.229648] ---[ end trace 0000000000000000 ]---
[   29.284386] RTW: assoc success

chrisvollorenew avatar Nov 27 '22 19:11 chrisvollorenew

You should try arm or arm64. The error netdevice: wlan0: Incorrect netdev->dev_addr maybe endianness issue?

RinCat avatar Nov 27 '22 22:11 RinCat

Thank you @RinCat - can you please elaborate? My make command is basically as follows - make ARCH=ARM KSRC=${STAGING_KERNEL_BUILDDIR} CONFIG_RTL8822BU=m USER_EXTRA_CFLAGS='-DCONFIG_CONCURRENT_MODE'

I tried to use CONFIG_PLATFORM_ARM_SUNxI=y but the build failed.

chrisvollorenew avatar Nov 28 '22 14:11 chrisvollorenew

I tried CONFIG_PLATFORM_ARM_SUNxI=y, but that related code had not been updated over 5 years. Do not expect it will works.

I just noticed:

[   28.549256] rtl88x2bu 1-1:1.2 wlan1: Current addr:  62 1d 9d da 7e ae 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[   28.562856] rtl88x2bu 1-1:1.2 wlan1: Expected addr: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

So it was got a empty MAC address then changed, not sure how that happened.

RinCat avatar Nov 30 '22 05:11 RinCat

Here's my build log from Yocto in case someone is interested in trying to fix this ...

CONFIG_PLATFORM_ARM_SUNxI.88x2bu.log

@RinCat what is your thought on the issue? How could I fix the mac address issue above?

chrisvollorenew avatar Nov 30 '22 14:11 chrisvollorenew

mach/sys_config.h had been removed long times ago, I don't know what should to use now.

The MAC issue maybe a bug, I will check it later.

RinCat avatar Nov 30 '22 16:11 RinCat

@RinCat thank you.

For the SUNxI support, it would be nice. I did some research - It looks like we might be able to remove mach/sys_config.h and modify the code to replace. Basically the output from those functions in sys_config.h doesn't seem to be of critical importance.

Here is the mach/sys_config.h ... it only has a few function definitions that start with script_ https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/arch/arm/mach-sunxi/include/mach/sys_config.h

Here's the file in this repo that references those functions, it looks like those functuons are only used to detect errors, and may not be critical to the main operations of the wifi driver ...

https://github.com/RinCat/RTL88x2BU-Linux-Driver/blob/657b7cfde9958e273febdeaeac579902e407f577/platform/platform_ARM_SUNxI_usb.c

I wonder if it is worth a shot on removing and tring to compile?

chrisvollorenew avatar Nov 30 '22 21:11 chrisvollorenew

I am going to create a new issue for SUNxI support

chrisvollorenew avatar Nov 30 '22 21:11 chrisvollorenew