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

Kernel oops 5.4.52: TP-Link AC1300

Open parthitce opened this issue 5 years ago • 6 comments

Device: TP-Link AC1300

> lsusb
Bus 001 Device 017: ID 2357:0138 TP-Link

Kernel SHA: c57b1153a58a6263863667296b5f00933fc46a4f Kernel version 5.4.52 Hardware platform: imx6ULL SoC based custom board

After inserting the module manually, the device is detected and wlan0 interface is up and running. But the below kernel oops is printed on the console.

Question: I pulled the current master and cross compiled manually with 5.4.52 tree. Is this a problem as the version in module is points to 5.8?

Console log:

# insmod ./88x2bu.ko                                                                                                                    [110/7975]
[  341.364627] RTW: module init start                                                                                                                         
[  341.368117] RTW: rtl88x2bu 5.4.52-00003-g212cb315f232                                                                                                      
[  341.373727] RTW: build time: Sep 14 2020 12:17:16                                                                                                          
[  341.378497] RTW: rtl88x2bu BT-Coex version = COEX20191120-7777                                                                                             
[  341.396587] RTW: [HALMAC]11692M                                                                                                                            
[  341.396587] HALMAC_MAJOR_VER = 1                                                                                                                           
[  341.396587] HALMAC_PROTOTYPE_VER = 6                                                                                                                       
[  341.396587] HALMAC_MINOR_VER = 5                                                                                                                           
[  341.396587] HALMAC_PATCH_VER = 6*                                                                                                                          
[  341.423948] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend                                                                                                  
[  342.516425] RTW: HW EFUSE                                                                                                                                  
[  342.519142] RTW: 0x000: 29 81 00 3C  09 00 A1 00  B6 04 64 10  00 00 A3 00                                                                                 
[  342.526762] RTW: 0x010: 2D 2D 2E 2E  2E 2E 2B 2C  2C 2D 2D 14  00 00 FF FF                                                                                 
[  342.534188] RTW: 0x020: FF FF 25 24  24 24 23 23  23 23 24 26  28 28 28 28                                                                                 
[  342.541497] RTW: 0x030: 13 00 FF FF  00 FF 1C 00  FF FF 2C 2D  2D 2E 2E 2E                                                                                 
[  342.548741] RTW: 0x040: 2C 2C 2C 2D  2D 14 00 00  FF FF FF FF  29 27 26 26   
[  342.556042] RTW: 0x050: 25 25 24 24  25 26 27 28  28 28 13 00  FF FF 00 FF  
[  342.563333] RTW: 0x060: 1C 00 FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.570617] RTW: 0x070: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.577812] RTW: 0x080: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.585082] RTW: 0x090: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.592351] RTW: 0x0A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.599533] RTW: 0x0B0: FF FF FF FF  FF FF FF FF  A6 2F 1E 00  FF FF FF FF  
[  342.606804] RTW: 0x0C0: FF 01 00 11  00 00 00 00  00 FF 03 FF  FF FF FF FF   
[  342.614079] RTW: 0x0D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.621352] RTW: 0x0E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.628536] RTW: 0x0F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.635815] RTW: 0x100: 57 23 38 01  E1 67 02 98  48 27 7A 47  48 09 03 52  
[  342.643082] RTW: 0x110: 65 61 6C 74  65 6B 0E 03  38 30 32 2E  31 31 61 63   
[  342.650352] RTW: 0x120: 20 4E 49 43  08 03 31 32  33 34 35 36  FF FF FF FF   
[  342.657537] RTW: 0x130: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.664801] RTW: 0x140: 33 0A 1F 01  00 00 21 0F  FF FF FF FF  FF FF FF FF   
[  342.672069] RTW: 0x150: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.679252] RTW: 0x160: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.686518] RTW: 0x170: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.693791] RTW: 0x180: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.701067] RTW: 0x190: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.708249] RTW: 0x1A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.715520] RTW: 0x1B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.722789] RTW: 0x1C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF
[  342.730057] RTW: 0x1D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.737238] RTW: 0x1E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.744501] RTW: 0x1F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.751771] RTW: 0x200: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.758955] RTW: 0x210: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.766221] RTW: 0x220: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.773561] RTW: 0x230: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.780858] RTW: 0x240: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.788050] RTW: 0x250: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.795326] RTW: 0x260: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.802608] RTW: 0x270: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.809795] RTW: 0x280: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.817066] RTW: 0x290: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.824337] RTW: 0x2A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.831606] RTW: 0x2B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.838791] RTW: 0x2C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.846060] RTW: 0x2D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  342.853337] RTW: 0x2E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.860604] RTW: 0x2F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF   
[  342.867809] RTW: hal_com_config_channel_plan chplan:0x26
[  342.893773] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  342.933268] RTW: [HALMAC][ALWAYS]shall R reg twice!!
[  343.171670] 
[  343.173213] ============================================
[  343.178541] WARNING: possible recursive locking detected
[  343.183876] 5.4.52-00003-g212cb315f232 #1 Tainted: G           O     
[  343.190330] --------------------------------------------
[  343.195659] insmod/488 is trying to acquire lock:
[  343.200380] c8a711c8 (pmutex){+.+.}, at: usbctrl_vendorreq+0x94/0x448 [88x2bu]
[  343.209433] 
[  343.209433] but task is already holding lock:
[  343.215285] c8a70118 (pmutex){+.+.}, at: rtw_halmac_send_h2c+0x8c/0x224 [88x2bu]
[  343.224457] 
[  343.224457] other info that might help us debug this:
[  343.230999]  Possible unsafe locking scenario:
[  343.230999] 
[  343.236931]        CPU0
[  343.239391]        ----
[  343.241847]   lock(pmutex);                                                                                                                                
[  343.244660]   lock(pmutex);                                                                                                                                
[  343.247472] 
[  343.247472]  *** DEADLOCK ***
[  343.247472] 
[  343.253404]  May be due to missing lock nesting notation
[  343.253404] 
[  343.260208] 3 locks held by insmod/488:
[  343.264057]  #0: c8f96134 (&dev->mutex){....}, at: __device_driver_lock+0x3c/0x4c
[  343.271590]  #1: c86444dc (&dev->mutex){....}, at: device_driver_attach+0x18/0x60
[  343.279112]  #2: c8a70118 (pmutex){+.+.}, at: rtw_halmac_send_h2c+0x8c/0x224 [88x2bu]
[  343.288718] 
[  343.288718] stack backtrace:
[  343.293105] CPU: 0 PID: 488 Comm: insmod Tainted: G           O      5.4.52-00003-g212cb315f232 #1
[  343.302081] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[  343.308315] [<c0112ca0>] (unwind_backtrace) from [<c010ce5c>] (show_stack+0x10/0x14)
[  343.316103] [<c010ce5c>] (show_stack) from [<c0c4c01c>] (dump_stack+0xe4/0x11c)
[  343.323453] [<c0c4c01c>] (dump_stack) from [<c0181e40>] (__lock_acquire+0xee8/0x2408)
[  343.331318] [<c0181e40>] (__lock_acquire) from [<c0183bd8>] (lock_acquire+0xcc/0x1e8)
[  343.339186] [<c0183bd8>] (lock_acquire) from [<c0c69cb4>] (__mutex_lock+0x74/0x96c)
[  343.346881] [<c0c69cb4>] (__mutex_lock) from [<c0c6a5c8>] (mutex_lock_nested+0x1c/0x24)
[  343.356634] [<c0c6a5c8>] (mutex_lock_nested) from [<bf11ebcc>] (usbctrl_vendorreq+0x94/0x448 [88x2bu])
[  343.369433] [<bf11ebcc>] (usbctrl_vendorreq [88x2bu]) from [<bf179364>] (usb_read8+0x3c/0x60 [88x2bu])
[  343.382216] [<bf179364>] (usb_read8 [88x2bu]) from [<bf18e920>] (rtw_halmac_send_h2c+0xc0/0x224 [88x2bu])
[  343.395250] [<bf18e920>] (rtw_halmac_send_h2c [88x2bu]) from [<bf18eccc>] (_send_general_info+0x248/0x350 [88x2bu])
[  343.409155] [<bf18eccc>] (_send_general_info [88x2bu]) from [<bf190060>] (rtw_halmac_dlfw+0x88/0xb0 [88x2bu])
[  343.422527] [<bf190060>] (rtw_halmac_dlfw [88x2bu]) from [<bf180a08>] (rtl8822b_fw_dl+0x3c/0x154 [88x2bu])
[  343.435653] [<bf180a08>] (rtl8822b_fw_dl [88x2bu]) from [<bf14fe4c>] (hal_read_mac_hidden_rpt+0x7c/0x268 [88x2bu])
[  343.449478] [<bf14fe4c>] (hal_read_mac_hidden_rpt [88x2bu]) from [<bf186750>] (rtl8822b_read_efuse+0x3f8/0xc5c [88x2bu])
[  343.463797] [<bf186750>] (rtl8822b_read_efuse [88x2bu]) from [<bf18be80>] (read_adapter_info+0xc/0x3c [88x2bu])
[  343.477369] [<bf18be80>] (read_adapter_info [88x2bu]) from [<bf14c66c>] (rtw_hal_read_chip_info+0x88/0xdc [88x2bu])
[  343.491286] [<bf14c66c>] (rtw_hal_read_chip_info [88x2bu]) from [<bf11dce4>] (rtw_usb_primary_adapter_init+0x104/0x2b4 [88x2bu])
[  343.506340] [<bf11dce4>] (rtw_usb_primary_adapter_init [88x2bu]) from [<bf11e094>] (rtw_drv_init+0x200/0x6bc [88x2bu])
[  343.518823] [<bf11e094>] (rtw_drv_init [88x2bu]) from [<c07ec0e0>] (usb_probe_interface+0xcc/0x234)
[  343.527929] [<c07ec0e0>] (usb_probe_interface) from [<c06c4374>] (really_probe+0x214/0x344)
[  343.536319] [<c06c4374>] (really_probe) from [<c06c4618>] (driver_probe_device+0x5c/0x164)
[  343.544616] [<c06c4618>] (driver_probe_device) from [<c06c48c8>] (device_driver_attach+0x58/0x60)
[  343.553519] [<c06c48c8>] (device_driver_attach) from [<c06c4954>] (__driver_attach+0x84/0xc0)                                                              
[  343.562075] [<c06c4954>] (__driver_attach) from [<c06c26b0>] (bus_for_each_dev+0x70/0xb4)                                                                  
[  343.570288] [<c06c26b0>] (bus_for_each_dev) from [<c06c36a4>] (bus_add_driver+0x154/0x1e0)                                                                 
[  343.578583] [<c06c36a4>] (bus_add_driver) from [<c06c55e8>] (driver_register+0x74/0x108)                                                                   
[  343.586705] [<c06c55e8>] (driver_register) from [<c07ead98>] (usb_register_driver+0x78/0x14c)                                                              
[  343.596979] [<c07ead98>] (usb_register_driver) from [<bf01b0bc>] (rtw_drv_entry+0xbc/0x1000 [88x2bu])                                                      
[  343.607981] [<bf01b0bc>] (rtw_drv_entry [88x2bu]) from [<c0103154>] (do_one_initcall+0x80/0x340)
[  343.616828] [<c0103154>] (do_one_initcall) from [<c01d947c>] (do_init_module+0x5c/0x224)
[  343.624955] [<c01d947c>] (do_init_module) from [<c01d8388>] (load_module+0x1f4c/0x2590)
[  343.632991] [<c01d8388>] (load_module) from [<c01d8c10>] (sys_finit_module+0xa4/0xd8)
[  343.640853] [<c01d8c10>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
[  343.649051] Exception stack(0xc8b15fa8 to 0xc8b15ff0)
[  343.654132] 5fa0:                   e450bb00 beaa4e14 00000003 01ffb190 00000000 beaa4f19
[  343.662337] 5fc0: e450bb00 beaa4e14 00000002 0000017b 00000000 00000000 0053ea84 00000000
[  343.670534] 5fe0: beaa4c70 beaa4c60 004c8f7f b6e2c942
[  343.711720] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  343.719365] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  343.725556] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  343.732804] RTW: [RF_PATH] ver_id.RF_TYPE:RF_2T2R, rf_reg_path_num:2, max_tx_cnt:2
[  343.740659] RTW: [RF_PATH] PG's trx_path_bmp:0x00, max_tx_cnt:0
[  343.746802] RTW: [RF_PATH] Registry's RF PATH:UNKNOWN
[  343.752179] RTW: [RF_PATH] HALDATA's trx_path_bmp:0x33, max_tx_cnt:2
[  343.758575] RTW: [RF_PATH] HALDATA's rf_type:RF_2T2R
[  343.763683] RTW: [RF_PATH] NumTotalRFPath:2
[  343.767906] RTW: [TRX_Nss] HALSPEC - tx_nss :2, rx_nss:2
[  343.773404] RTW: [TRX_Nss] Registry - tx_nss :0, rx_nss:0
[  343.778842] RTW: [TRX_Nss] HALDATA - tx_nss :2, rx_nss:2
[  343.793391] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1
[  343.813254] RTW: rtw_ndev_init(wlan0) if1 mac_addr=98:48:27:7a:47:48
[  343.839030] usbcore: registered new interface driver rtl88x2bu
[  343.845157] RTW: module init ret=0

parthitce avatar Sep 14 '20 12:09 parthitce

I also see the deadlock on different i.MX6 platforms. I have tried several versions of the Realtek driver with kernel 4.14 and 5.7.1.

But until now I have no idea what the reason for the message is.

matthiasklein avatar Sep 14 '20 12:09 matthiasklein

I also see the deadlock on different i.MX6 platforms. I have tried several versions of the Realtek driver with kernel 4.14 and 5.7.1.

But until now I have no idea what the reason for the message is.

@matthiasklein Thanks for your update. I hope still this is something to do with the Realtek driver itself? If not, it makes sense to open a thread in community.nxp.com as well.

parthitce avatar Sep 14 '20 12:09 parthitce

@parthitce Yes, I think it is a problem in the Realtek driver, which is either caused by " unfavorable" combinations in the kernel options or by timing effects in the IMX.6 USB host driver.

But I do not know ...

What does your hardware look like? Is it based on a commercially available SoM? Can you share your kernel configuration?

matthiasklein avatar Sep 14 '20 14:09 matthiasklein

What does your hardware look like? Is it based on a commercially available SoM? Can you share your kernel configuration?

@matthiasklein Thanks, yes it is based on Phytec imx6ULL SoM with NAND.

Kernel version: Mainline stable 5.4.52 (with custom patches for custom board device tree alone, nothing much here) Defconfig: Mainline imx_v6_v7_defconfig

parthitce avatar Sep 14 '20 14:09 parthitce

I just tested it on 5.4.60 x86_64, and didn't see this issue. So it either ARM platform USB driver or the specific SoC USB driver had some special behavior.

RinCat avatar Sep 14 '20 21:09 RinCat

I just tested it on 5.4.60 x86_64, and didn't see this issue. So it either ARM platform USB driver or the specific SoC USB driver had some special behavior.

Thanks @RinCat. I will post in kernel USB mailing list and nxp community.

parthitce avatar Sep 15 '20 09:09 parthitce