Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iw dev del hangs in OpenWrt #12

Open
uberf0x opened this issue Feb 2, 2023 · 14 comments
Open

iw dev del hangs in OpenWrt #12

uberf0x opened this issue Feb 2, 2023 · 14 comments

Comments

@uberf0x
Copy link

uberf0x commented Feb 2, 2023

Hi,
the driver was successfully built for OpenWrt using buildroot, but doesn't recognize my adapter (TL-WN 722N v3).
Seems like the module is loaded ok, but when inserting an adapter it fails to init.
Kernel log and other info are below:

[ 18.323455] RTW: module init start
[ 18.326938] RTW: rtl8188eu v5.13.3-17-gb1925f81a.20210615
[ 18.332310] RTW: build time: Sep 3 2022 02:55:34
[ 18.337089] RTW: rtw_inetaddr_notifier_register
[ 18.341786] usbcore: registered new interface driver rtl8188eu
[ 18.347679] RTW: module init ret=0

[ 309.844214] usb 1-1: new high-speed USB device number 2 using xhci-mtk
[ 310.026773] RTW:
[ 310.026773] usb_endpoint_descriptor(0):
[ 310.032562] RTW: bLength=7
[ 310.035612] RTW: bDescriptorType=5
[ 310.039051] RTW: bEndpointAddress=81
[ 310.042633] RTW: wMaxPacketSize=512
[ 310.046201] RTW: bInterval=0
[ 310.049339] RTW: RT_usb_endpoint_is_bulk_in = 1
[ 310.053855] RTW:
[ 310.053855] usb_endpoint_descriptor(1):
[ 310.059657] RTW: bLength=7
[ 310.062613] RTW: bDescriptorType=5
[ 310.066294] RTW: bEndpointAddress=2
[ 310.069987] RTW: wMaxPacketSize=512
[ 310.073464] RTW: bInterval=0
[ 310.076397] RTW: RT_usb_endpoint_is_bulk_out = 2
[ 310.081219] RTW:
[ 310.081219] usb_endpoint_descriptor(2):
[ 310.087197] RTW: bLength=7
[ 310.090074] RTW: bDescriptorType=5
[ 310.093467] RTW: bEndpointAddress=3
[ 310.097006] RTW: wMaxPacketSize=512
[ 310.100697] RTW: bInterval=0
[ 310.103571] RTW: RT_usb_endpoint_is_bulk_out = 3
[ 310.108225] RTW: nr_endpoint=3, in_num=1, out_num=2
[ 310.108225]
[ 310.114786] RTW: USB_SPEED_HIGH
[ 310.118131] RTW: CHIP TYPE: RTL8188E
[ 310.122105] RTW: Chip Version Info: CHIP_8188E_T4_1T1R_RomVer(0)
[ 310.128540] RTW: _ConfigNormalChipOutEP_8188E OutEpQueueSel(0x05), OutEpNumber(2)
[ 310.136480] RTW: EEPROM type is E-FUSE
[ 310.140324] RTW: Boot from EFUSE, Autoload OK !
[ 310.147528] RTW: SetHwReg: bMacPwrCtrlOn=1
[ 310.151830] bFWReady == _FALSE call reset 8051...
[ 310.157552] RTW: =====> _8051Reset88E(): 8051 reset success .
[ 310.177755] RTW: efuse_read_phymap_from_txpktbuf bcnhead:0
[ 310.183546] RTW: efuse_read_phymap_from_txpktbuf len:125
[ 310.194430] RTW: efuse_read_phymap_from_txpktbuf read count:123
[ 310.200662] RTW: HW EFUSE
[ 310.203306] RTW: 0x000: 29 81 00 6C 0B 00 00 00 00 0C 00 00 00 00 00 00
[ 310.210723] RTW: 0x010: 30 30 2F 2F 2F 2F 34 34 33 32 32 F1 FF FF FF FF
[ 310.218090] RTW: 0x020: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.225230] RTW: 0x030: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.232705] RTW: 0x040: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.240023] RTW: 0x050: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.247361] RTW: 0x060: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.254876] RTW: 0x070: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.261972] RTW: 0x080: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.269094] RTW: 0x090: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.276618] RTW: 0x0A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.283716] RTW: 0x0B0: FF FF FF FF FF FF FF FF A1 2F 18 00 00 00 00 00
[ 310.290838] RTW: 0x0C0: 00 01 00 10 00 00 00 00 00 03 FF FF FF FF FF FF
[ 310.298382] RTW: 0x0D0: 57 23 0C 01 43 66 00 D0 37 45 AE F4 AF 09 03 52
[ 310.305524] RTW: 0x0E0: 65 61 6C 74 65 6B 0D 03 38 30 32 2E 31 31 6E 20
[ 310.313022] RTW: 0x0F0: 4E 49 43 0C 03 30 30 45 30 34 43 30 30 30 31 00
[ 310.320154] RTW: 0x100: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.327672] RTW: 0x110: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.334808] RTW: 0x120: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.342293] RTW: 0x130: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.349426] RTW: 0x140: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.356969] RTW: 0x150: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.364061] RTW: 0x160: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.371566] RTW: 0x170: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.378695] RTW: 0x180: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.386224] RTW: 0x190: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.393321] RTW: 0x1A0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.400444] RTW: 0x1B0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.407982] RTW: 0x1C0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.415311] RTW: 0x1D0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.422626] RTW: 0x1E0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.429755] RTW: 0x1F0: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
[ 310.437311] RTW: EEPROM ID=0x8129
[ 310.440614] RTW: VID = 0x2357, PID = 0x010C
[ 310.444816] RTW: Customer ID: 0x00, SubCustomer ID: 0xCD
[ 310.450302] RTW: Hal_ReadPowerSavingMode88E...bHWPwrPindetect(0)-bHWPowerdown(0) ,bSupportRemoteWakeup(1)
[ 310.459870] RTW: ### PS params=> power_mgnt(2),usbss_enable(0) ###
[ 310.466342] RTW: EEPROMRegulatory = 0x1
[ 310.470360] RTW: hal_com_config_channel_plan chplan:0x21
[ 310.475888] RTW: crystal_cap: 0x2f
[ 310.479457] RTW: EEPROM Customer ID: 0x 0
[ 310.483447] RTW: Board Type: 0x 0
[ 310.486786] RTW: ThermalMeter = 0x18
[ 310.490541] RTW: pHalData->ExternalPA_2G = 0 , pHalData->ExternalLNA_2G = 0
[ 310.497513] RTW: pHalData->TypeGLNA is 0x0
[ 310.501786] RTW: pHalData->rfe_type is 0xff
[ 310.505994] RTW: rtw_hal_read_chip_info in 370 ms
[ 310.510910] RTW: [RF_PATH] ver_id.RF_TYPE:RF_1T1R
[ 310.515642] RTW: [RF_PATH] HALSPEC's rf_reg_trx_path_bmp:0x11, rf_reg_path_avail_num:1, max_tx_cnt:1
[ 310.524782] RTW: [RF_PATH] PG's trx_path_bmp:0x00, max_tx_cnt:0
[ 310.530873] RTW: [RF_PATH] Registry's trx_path_bmp:0x00, tx_path_lmt:0, rx_path_lmt:0
[ 310.538915] RTW: [RF_PATH] HALDATA's trx_path_bmp:0x11, max_tx_cnt:1
[ 310.545469] RTW: [RF_PATH] HALDATA's rf_type:RF_1T1R, NumTotalRFPath:1
[ 310.552168] RTW: rtw_hal_rfpath_init trx_path_bmp:0x11(RF_1T1R), NumTotalRFPath:1, max_tx_cnt:1
[ 310.560871] RTW: [TRX_Nss] HALSPEC - tx_nss:1, rx_nss:1
[ 310.566307] RTW: [TRX_Nss] Registry - tx_nss:0, rx_nss:0
[ 310.571794] RTW: [TRX_Nss] HALDATA - tx_nss:1, rx_nss:1
[ 310.577038] RTW: rtw_hal_trxnss_init tx_nss:1, rx_nss:1
[ 310.582445] RTW: txpath=0x1, rxpath=0x1
[ 310.586308] RTW: txpath_1ss:0x1, num:1
[ 310.590560] RTW: init_mlme_default_rate_set: support CCK
[ 310.596215] RTW: init_mlme_default_rate_set: support OFDM
[ 310.602600] RTW: NR_RECVBUFF: 8, recvbuf_nr: 8
[ 310.607431] RTW: MAX_RECVBUF_SZ: 15360
[ 310.611205] RTW: NR_PREALLOC_RECV_SKB: 8
[ 310.615157] RTW: Enable CONFIG_FIX_NR_BULKIN_BUFFER
[ 310.620704] RTW: rtw_alloc_macid((null)) if1, mac_addr:ff:ff:ff:ff:ff:ff macid:1
[ 310.628213] RTW: rtw_init_pwrctrl_priv: IPS_mode=1, LPS_mode=2, LPS_level=0
[ 310.635234] RTW: IQK FW offload:disable
[ 310.639140] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1
[ 310.648436] RTW: phy_ConfigBBWithPgParaFile(): No File PHY_REG_PG.txt, Load from HWImg Array!
[ 310.657024] RTW: default power by rate loaded
[ 310.661385] RTW: init_channel_set_from_rtk_priv((null)) ChannelPlan ID:0x21, ch num:13
[ 310.670237] RTW: rtw_macaddr_cfg mac addr:d0:37:45:ae:f4:af
[ 310.675838] RTW: bDriverStopped:True, bSurpriseRemoved:False, bup:0, hw_init_completed:0
[ 310.684197] RTW: rtw_cfg80211_init_wiphy_band:rf_type=0
[ 310.689631] RTW: [HT] HAL Support STBC = 0x01
[ 310.693983] RTW: rtw_wiphy_alloc((null))
[ 310.698168] RTW: rtw_wdev_alloc(padapter=09c77e86)
[ 310.703146] RTW: rtw_wiphy_register((null))
[ 310.707358] RTW: Register RTW cfg80211 vendor cmd(0x67) interface
[ 310.713643] ------------[ cut here ]------------
[ 310.718540] WARNING: CPU: 0 PID: 796 at backports-5.15.58-1/net/wireless/core.c:785 0x82a80c5c [cfg80211@2b77c6c7+0x45f40]
[ 310.729776] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet 8188eu pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt76x2e mt76x2_common mt76x02_lib mt7603e mt76 mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_ipv6 nf_log_ipv4 nf_log_common nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c crc_ccitt compat ledtrig_usbport sha256_generic libsha256 seqiv jitterentropy_rng drbg hmac cmac leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common crc32c_generic
[ 310.801286] CPU: 0 PID: 796 Comm: kworker/0:3 Not tainted 5.10.138 #0
[ 310.807768] Workqueue: usb_hub_wq 0x82485a08 [usbcore@e59c15c6+0x23fc0]
[ 310.814360] Stack : 00000000 807200d8 809a0000 c0c12000 00000000 00000000 00000000 00000000
[ 310.822704] 00000000 00000000 00000000 00000000 00000000 00000001 829677f0 449ed92d
[ 310.831047] 82967888 00000000 00000000 82967680 00000038 80399864 ffffffea 00000000
[ 310.839392] 8296768c 000001c8 807c2868 ffffffff 829677d0 806ef0cc 00000000 806f0000
[ 310.847738] 00000009 837672c4 82ebfc00 c0c12000 00000018 80403190 00055bef 00072fef
[ 310.856084] ...
[ 310.858522] Call Trace:
[ 310.858547] [<80399864>] 0x80399864
[ 310.864452] [<80403190>] 0x80403190
[ 310.867927] [<80007b08>] 0x80007b08
[ 310.871397] [<80007b10>] 0x80007b10
[ 310.874868] [<8037e984>] 0x8037e984
[ 310.878347] [<82a80c5c>] 0x82a80c5c [cfg80211@2b77c6c7+0x45f40]
[ 310.884239] [<8007fa1c>] 0x8007fa1c
[ 310.887719] [<82a80c5c>] 0x82a80c5c [cfg80211@2b77c6c7+0x45f40]
[ 310.893609] [<8002ff38>] 0x8002ff38
[ 310.897089] [<82a80c5c>] 0x82a80c5c [cfg80211@2b77c6c7+0x45f40]
[ 310.902981] [<80030000>] 0x80030000
[ 310.906469] [<82a80c5c>] 0x82a80c5c [cfg80211@2b77c6c7+0x45f40]
[ 310.912373] [<8007fa1c>] 0x8007fa1c
[ 310.915862] [<836a3038>] 0x836a3038 [8188eu@67a92391+0x183db0]
[ 310.921677] [<836a257c>] 0x836a257c [8188eu@67a92391+0x183db0]
[ 310.927488] [<8367d2d0>] 0x8367d2d0 [8188eu@67a92391+0x183db0]
[ 310.933298] [<836a2af0>] 0x836a2af0 [8188eu@67a92391+0x183db0]
[ 310.939105] [<80083418>] 0x80083418
[ 310.942583] [<8367e598>] 0x8367e598 [8188eu@67a92391+0x183db0]
[ 310.948393] [<8007fa1c>] 0x8007fa1c
[ 310.951882] [<8367e7b0>] 0x8367e7b0 [8188eu@67a92391+0x183db0]
[ 310.957695] [<836810ec>] 0x836810ec [8188eu@67a92391+0x183db0]
[ 310.963527] [<82490084>] 0x82490084 [usbcore@e59c15c6+0x23fc0]
[ 310.969333] [<80414ed8>] 0x80414ed8
[ 310.972808] [<804158ac>] 0x804158ac
[ 310.976279] [<8041619c>] 0x8041619c
[ 310.979753] [<8041611c>] 0x8041611c
[ 310.983225] [<8041334c>] 0x8041334c
[ 310.986711] [<80415eb0>] 0x80415eb0
[ 310.990185] [<80383d68>] 0x80383d68
[ 310.993667] [<804147e0>] 0x804147e0
[ 310.997144] [<80410250>] 0x80410250
[ 311.000623] [<8248c148>] 0x8248c148 [usbcore@e59c15c6+0x23fc0]
[ 311.006456] [<8248ebd8>] 0x8248ebd8 [usbcore@e59c15c6+0x23fc0]
[ 311.012285] [<8248cd14>] 0x8248cd14 [usbcore@e59c15c6+0x23fc0]
[ 311.018121] [<82499884>] 0x82499884 [usbcore@e59c15c6+0x23fc0]
[ 311.023941] [<8248f374>] 0x8248f374 [usbcore@e59c15c6+0x23fc0]
[ 311.029751] [<8041611c>] 0x8041611c
[ 311.033224] [<804158ac>] 0x804158ac
[ 311.036698] [<8041619c>] 0x8041619c
[ 311.040171] [<8041611c>] 0x8041611c
[ 311.043641] [<8041334c>] 0x8041334c
[ 311.047127] [<80415eb0>] 0x80415eb0
[ 311.050602] [<80383d68>] 0x80383d68
[ 311.054083] [<804147e0>] 0x804147e0
[ 311.057560] [<80410250>] 0x80410250
[ 311.061035] [<80408d24>] 0x80408d24
[ 311.064532] [<82485488>] 0x82485488 [usbcore@e59c15c6+0x23fc0]
[ 311.070361] [<824869c0>] 0x824869c0 [usbcore@e59c15c6+0x23fc0]
[ 311.076168] [<80064870>] 0x80064870
[ 311.079662] [<80060714>] 0x80060714
[ 311.083136] [<80049d00>] 0x80049d00
[ 311.086615] [<8004a0e4>] 0x8004a0e4
[ 311.090085] [<80049f64>] 0x80049f64
[ 311.093562] [<80049f64>] 0x80049f64
[ 311.097037] [<80050c10>] 0x80050c10
[ 311.100507] [<80050ad4>] 0x80050ad4
[ 311.103979] [<80050ad4>] 0x80050ad4
[ 311.107454] [<80050ad4>] 0x80050ad4
[ 311.110924] [<80002f38>] 0x80002f38
[ 311.114403]
[ 311.116268] ---[ end trace defb7fa35784cd5c ]---
[ 311.121107] ------------[ cut here ]------------
[ 311.125792] WARNING: CPU: 0 PID: 796 at backports-5.15.58-1/net/wireless/core.c:882 0x82a812dc [cfg80211@2b77c6c7+0x45f40]
[ 311.137082] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet 8188eu pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt76x2e mt76x2_common mt76x02_lib mt7603e mt76 mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_ipv6 nf_log_ipv4 nf_log_common nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c crc_ccitt compat ledtrig_usbport sha256_generic libsha256 seqiv jitterentropy_rng drbg hmac cmac leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common crc32c_generic
[ 311.208645] CPU: 0 PID: 796 Comm: kworker/0:3 Tainted: G W 5.10.138 #0
[ 311.216503] Workqueue: usb_hub_wq 0x82485a08 [usbcore@e59c15c6+0x23fc0]
[ 311.223090] Stack : 00000000 807200d8 809a0000 c0c12000 00000000 00000000 00000000 00000000
[ 311.231435] 00000000 00000000 00000000 00000000 00000000 00000001 829677f0 449ed92d
[ 311.239779] 82967888 00000000 00000000 82967680 00000038 80399864 ffffffea 00000000
[ 311.248125] 8296768c 00000212 807c2868 ffffffff 829677d0 806ef0cc 00000000 806f0000
[ 311.256470] 00000009 837672c4 82ebfc00 c0c12000 00000018 80403190 00000000 80980000
[ 311.264816] ...
[ 311.267255] Call Trace:
[ 311.267276] [<80399864>] 0x80399864
[ 311.273179] [<80403190>] 0x80403190
[ 311.276656] [<80007b08>] 0x80007b08
[ 311.280127] [<80007b10>] 0x80007b10
[ 311.283596] [<8037e984>] 0x8037e984
[ 311.287076] [<82a812dc>] 0x82a812dc [cfg80211@2b77c6c7+0x45f40]
[ 311.292967] [<8007fa1c>] 0x8007fa1c
[ 311.296448] [<82a812dc>] 0x82a812dc [cfg80211@2b77c6c7+0x45f40]
[ 311.302338] [<8002ff38>] 0x8002ff38
[ 311.305819] [<82a812dc>] 0x82a812dc [cfg80211@2b77c6c7+0x45f40]
[ 311.311711] [<80030000>] 0x80030000
[ 311.315199] [<82a812dc>] 0x82a812dc [cfg80211@2b77c6c7+0x45f40]
[ 311.321103] [<8007fa1c>] 0x8007fa1c
[ 311.324592] [<836a3038>] 0x836a3038 [8188eu@67a92391+0x183db0]
[ 311.330407] [<836a257c>] 0x836a257c [8188eu@67a92391+0x183db0]
[ 311.336218] [<8367d2d0>] 0x8367d2d0 [8188eu@67a92391+0x183db0]
[ 311.342029] [<836a2af0>] 0x836a2af0 [8188eu@67a92391+0x183db0]
[ 311.347836] [<80083418>] 0x80083418
[ 311.351314] [<8367e598>] 0x8367e598 [8188eu@67a92391+0x183db0]
[ 311.357123] [<8007fa1c>] 0x8007fa1c
[ 311.360612] [<8367e7b0>] 0x8367e7b0 [8188eu@67a92391+0x183db0]
[ 311.366426] [<836810ec>] 0x836810ec [8188eu@67a92391+0x183db0]
[ 311.372258] [<82490084>] 0x82490084 [usbcore@e59c15c6+0x23fc0]
[ 311.378063] [<80414ed8>] 0x80414ed8
[ 311.381538] [<804158ac>] 0x804158ac
[ 311.385010] [<8041619c>] 0x8041619c
[ 311.388484] [<8041611c>] 0x8041611c
[ 311.391956] [<8041334c>] 0x8041334c
[ 311.395442] [<80415eb0>] 0x80415eb0
[ 311.398916] [<80383d68>] 0x80383d68
[ 311.402398] [<804147e0>] 0x804147e0
[ 311.405875] [<80410250>] 0x80410250
[ 311.409353] [<8248c148>] 0x8248c148 [usbcore@e59c15c6+0x23fc0]
[ 311.415187] [<8248ebd8>] 0x8248ebd8 [usbcore@e59c15c6+0x23fc0]
[ 311.421016] [<8248cd14>] 0x8248cd14 [usbcore@e59c15c6+0x23fc0]
[ 311.426851] [<82499884>] 0x82499884 [usbcore@e59c15c6+0x23fc0]
[ 311.432671] [<8248f374>] 0x8248f374 [usbcore@e59c15c6+0x23fc0]
[ 311.438481] [<8041611c>] 0x8041611c
[ 311.441954] [<804158ac>] 0x804158ac
[ 311.445428] [<8041619c>] 0x8041619c
[ 311.448901] [<8041611c>] 0x8041611c
[ 311.452370] [<8041334c>] 0x8041334c
[ 311.455856] [<80415eb0>] 0x80415eb0
[ 311.459331] [<80383d68>] 0x80383d68
[ 311.462812] [<804147e0>] 0x804147e0
[ 311.466288] [<80410250>] 0x80410250
[ 311.469764] [<80408d24>] 0x80408d24
[ 311.473259] [<82485488>] 0x82485488 [usbcore@e59c15c6+0x23fc0]
[ 311.479089] [<824869c0>] 0x824869c0 [usbcore@e59c15c6+0x23fc0]
[ 311.484896] [<80064870>] 0x80064870
[ 311.488391] [<80060714>] 0x80060714
[ 311.491865] [<80049d00>] 0x80049d00
[ 311.495343] [<8004a0e4>] 0x8004a0e4
[ 311.498814] [<80049f64>] 0x80049f64
[ 311.502291] [<80049f64>] 0x80049f64
[ 311.505766] [<80050c10>] 0x80050c10
[ 311.509236] [<80050ad4>] 0x80050ad4
[ 311.512708] [<80050ad4>] 0x80050ad4
[ 311.516183] [<80050ad4>] 0x80050ad4
[ 311.519653] [<80002f38>] 0x80002f38
[ 311.523130]
[ 311.525026] ---[ end trace defb7fa35784cd5d ]---
[ 311.529895] ------------[ cut here ]------------
[ 311.534831] WARNING: CPU: 0 PID: 796 at target-mipsel_24kc_musl/linux-ramips_mt7621/rtl8188eu/os_dep/linux/os_intfs.c:3729 0x8367e5f8 [8188eu@67a92391+0x183db0]
[ 311.549154] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_ipv6 nf_flow_table_ipv4 nf_flow_table_inet 8188eu pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mt76x2e mt76x2_common mt76x02_lib mt7603e mt76 mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_ipv6 nf_log_ipv4 nf_log_common nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c crc_ccitt compat ledtrig_usbport sha256_generic libsha256 seqiv jitterentropy_rng drbg hmac cmac leds_gpio xhci_plat_hcd xhci_pci xhci_mtk xhci_hcd gpio_button_hotplug usbcore nls_base usb_common crc32c_generic
[ 311.620521] CPU: 0 PID: 796 Comm: kworker/0:3 Tainted: G W 5.10.138 #0
[ 311.628618] Workqueue: usb_hub_wq 0x82485a08 [usbcore@e59c15c6+0x23fc0]
[ 311.635212] Stack : 00000000 807200d8 809a0000 c0c12000 00000000 00000000 00000000 00000000
[ 311.643560] 00000000 00000000 00000000 00000000 00000000 00000001 82967880 449ed92d
[ 311.651903] 82967918 00000000 00000000 82967710 00000038 80399864 ffffffea 00000000
[ 311.660248] 8296771c 0000025c 807c2868 ffffffff 82967860 806ef0cc 00000000 806f0000
[ 311.668594] 00000009 00000000 82ebfc00 c0c12000 00000018 80403190 00000000 80980000
[ 311.676939] ...
[ 311.679377] Call Trace:
[ 311.679401] [<80399864>] 0x80399864
[ 311.685307] [<80403190>] 0x80403190
[ 311.688783] [<80007b08>] 0x80007b08
[ 311.692253] [<80007b10>] 0x80007b10
[ 311.695725] [<8037e984>] 0x8037e984
[ 311.699203] [<8367e5f8>] 0x8367e5f8 [8188eu@67a92391+0x183db0]
[ 311.705008] [<8007fa1c>] 0x8007fa1c
[ 311.708487] [<8367e5f8>] 0x8367e5f8 [8188eu@67a92391+0x183db0]
[ 311.714291] [<8002ff38>] 0x8002ff38
[ 311.717767] [<8367e5f8>] 0x8367e5f8 [8188eu@67a92391+0x183db0]
[ 311.723571] [<80030000>] 0x80030000
[ 311.727050] [<836a2af0>] 0x836a2af0 [8188eu@67a92391+0x183db0]
[ 311.732867] [<8367e5f8>] 0x8367e5f8 [8188eu@67a92391+0x183db0]
[ 311.738676] [<8007fa1c>] 0x8007fa1c
[ 311.742166] [<8367e7b0>] 0x8367e7b0 [8188eu@67a92391+0x183db0]
[ 311.747979] [<836810ec>] 0x836810ec [8188eu@67a92391+0x183db0]
[ 311.753811] [<82490084>] 0x82490084 [usbcore@e59c15c6+0x23fc0]
[ 311.759616] [<80414ed8>] 0x80414ed8
[ 311.763091] [<804158ac>] 0x804158ac
[ 311.766563] [<8041619c>] 0x8041619c
[ 311.770036] [<8041611c>] 0x8041611c
[ 311.773508] [<8041334c>] 0x8041334c
[ 311.776995] [<80415eb0>] 0x80415eb0
[ 311.780470] [<80383d68>] 0x80383d68
[ 311.783951] [<804147e0>] 0x804147e0
[ 311.787428] [<80410250>] 0x80410250
[ 311.790907] [<8248c148>] 0x8248c148 [usbcore@e59c15c6+0x23fc0]
[ 311.796740] [<8248ebd8>] 0x8248ebd8 [usbcore@e59c15c6+0x23fc0]
[ 311.802569] [<8248cd14>] 0x8248cd14 [usbcore@e59c15c6+0x23fc0]
[ 311.808405] [<82499884>] 0x82499884 [usbcore@e59c15c6+0x23fc0]
[ 311.814227] [<8248f374>] 0x8248f374 [usbcore@e59c15c6+0x23fc0]
[ 311.820036] [<8041611c>] 0x8041611c
[ 311.823508] [<804158ac>] 0x804158ac
[ 311.826982] [<8041619c>] 0x8041619c
[ 311.830455] [<8041611c>] 0x8041611c
[ 311.833925] [<8041334c>] 0x8041334c
[ 311.837410] [<80415eb0>] 0x80415eb0
[ 311.840885] [<80383d68>] 0x80383d68
[ 311.844368] [<804147e0>] 0x804147e0
[ 311.847844] [<80410250>] 0x80410250
[ 311.851317] [<80408d24>] 0x80408d24
[ 311.854814] [<82485488>] 0x82485488 [usbcore@e59c15c6+0x23fc0]
[ 311.860643] [<824869c0>] 0x824869c0 [usbcore@e59c15c6+0x23fc0]
[ 311.866449] [<80064870>] 0x80064870
[ 311.869944] [<80060714>] 0x80060714
[ 311.873418] [<80049d00>] 0x80049d00
[ 311.876896] [<8004a0e4>] 0x8004a0e4
[ 311.880366] [<80049f64>] 0x80049f64
[ 311.883844] [<80049f64>] 0x80049f64
[ 311.887318] [<80050c10>] 0x80050c10
[ 311.890789] [<80050ad4>] 0x80050ad4
[ 311.894263] [<80050ad4>] 0x80050ad4
[ 311.897737] [<80050ad4>] 0x80050ad4
[ 311.901205] [<80002f38>] 0x80002f38
[ 311.904684]
[ 311.906618] ---[ end trace defb7fa35784cd5e ]---
[ 311.911234] RTW: rtw_wdev_free(wdev=bd39dea1)
[ 311.915959] RTW: rtw_wiphy_free((null))
[ 311.920092] RTW: rtw_usb_primary_adapter_deinit((null))
[ 311.925338] RTW: rtw_dev_unload: bup==_FALSE
[ 311.929922] RTW: +r871xu_dev_remove, hw_init_completed=0
[ 311.936087] RTW: WARN free_recv_skb_queue not empty, 8

lsmod | grep 8188

8188eu 1588656 0
cfg80211 286528 6 8188eu,mt76x2_common,mt76x02_lib,mt7603e,mt76,mac80211
usbcore 147392 6 8188eu,ledtrig_usbport,xhci_plat_hcd,xhci_pci,xhci_mtk,xhci_hcd

lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux 5.10.138 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 2357:010c Realtek 802.11n NIC
Bus 001 Device 001: ID 1d6b:0002 Linux 5.10.138 xhci-hcd xHCI Host Controller

uname -r

5.10.138

Xiaomi Router 3G v1 using OpenWrt 22.03.0 r19685-512e76967f (ramips/mt7621)

Any suggestions how to fix it?

@ivanovborislav
Copy link
Owner

Hi.
I will check this.

@uberf0x
Copy link
Author

uberf0x commented Feb 19, 2023

Thanks, i've already found the problem. The errors above were caused by base kernel headers utilizing slightly different wiphy structure. Rebuilding the module against the backport solve the issue.
The module seems working fine now via ssh, but an attempt to enable radio in LuCI interface hangs it forever.
To be exact iw dev wlanN del hangs the module making it useless in OpenWrt, which does this command internally.

RTW: cfg80211_rtw_del_virtual_intf(wlan2) unregister ndev
RTW: rtw_wdev_unregister(wdev=62cdac68)

Then any network operations hang and the kernel is unable to reboot properly.

@uberf0x
Copy link
Author

uberf0x commented Feb 20, 2023

Looks like it's the common Realtek drivers problem according to this thread:
morrownr/8821cu-20210916#63
I've tested rtl8188eu drivers from other developers and got the same results. Both https://github.com/aircrack-ng/rtl8188eus and https://github.com/lwfinger/rtl8188eu/tree/v5.2.2.4 hang OpenWrt 22.03.0 after iw dev wlanN del command.
Then i did the same experiment with OpenWrt 21.02.0 r16279-5cc0535800 you mentioned as tested.
I built the drivers from all three repositories and ran iw dev wlanN del on OpenWrt 21.02.0.
Results as below:
ivanovborislav - ok
aircrack-ng - hangs
lwfinger - hangs
Your driver is the only has no "delete interface" issue, but for OpenWrt 21.02.0 only. Going to test lower OpenWrt version to make sure.

@uberf0x
Copy link
Author

uberf0x commented Feb 24, 2023

I did tests for all three drivers on OpenWrt 19.07.10 with the same results as for OpenWrt 21.02.0. Your driver is the only usable, but also has "client mode authorization" issue on this version of OpenWrt: #14

@uberf0x uberf0x changed the title Doesn't recognize adapter in OpenWrt iw dev del hangs in OpenWrt Feb 24, 2023
@ValterMinute
Copy link

Thanks, i've already found the problem. The errors above were caused by base kernel headers utilizing slightly different wiphy structure. Rebuilding the module against the backport solve the issue. The module seems working fine now via ssh, but an attempt to enable radio in LuCI interface hangs it forever. To be exact iw dev wlanN del hangs the module making it useless in OpenWrt, which does this command internally.

RTW: cfg80211_rtw_del_virtual_intf(wlan2) unregister ndev
RTW: rtw_wdev_unregister(wdev=62cdac68)

Then any network operations hang and the kernel is unable to reboot properly.

I think I am running into similar issues (on openwrt 22.03), can you pls detail better how did you built against backport?
I tried setting:
NOSTDINC_FLAGS="-I$(STAGING_DIR)/usr/include/mac80211
-I$(STAGING_DIR)/usr/include/mac80211/uapi
-I$(STAGING_DIR)/usr/include/mac80211-backport
-include backport/backport.h"

But I get weird build errors.

In file included from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/linux/bits.h:6,
from /home/valter/scorpio_v_next/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/bits.h:9,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/linux/bitops.h:5,
from /home/valter/scorpio_v_next/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/bitops.h:3,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/linux/kernel.h:12,
from /home/valter/scorpio_v_next/openwrt/staging_dir/target-aarch64_cortex-a53_musl/usr/include/mac80211-backport/linux/kernel.h:3,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/linux/list.h:9,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/linux/module.h:12,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/rtl8188eu-regular/rtl8188eu-b68c7da8/include/basic_types.h:76,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/rtl8188eu-regular/rtl8188eu-b68c7da8/include/drv_types.h:26,
from /home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/rtl8188eu-regular/rtl8188eu-b68c7da8/core/rtw_cmd.c:17:
/home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/linux-5.10.161/include/vdso/bits.h:7:33: error: expected identifier before '(' token
7 | #define BIT(nr) (UL(1) << (nr))
| ^
/home/valter/scorpio_v_next/openwrt/build_dir/target-aarch64_cortex-a53_musl/linux-bcm27xx_scorpio/rtl8188eu-regular/rtl8188eu-b68c7da8/include/ieee80211.h:61:23: note: in expansion of macro 'BIT'
61 | #define WLAN_STA_AUTH BIT(0)
| ^~~

@ValterMinute
Copy link

I managed to build the driver, now the device is detected and I can do a scan, but as soon as it tries to join a network it hangs.
I am using openwrt 22.0.3 on an arm64 device.

@uberf0x
Copy link
Author

uberf0x commented Mar 7, 2023

I managed to build the driver, now the device is detected and I can do a scan, but as soon as it tries to join a network it hangs. I am using openwrt 22.0.3 on an arm64 device.

Looks like the same issue i described above. When adding or modifying a network Openwrt internally executing delete and add a virtual wireless interface commands:

iw dev wlan2 del
iw phy phy2 interface add wlan2 type managed

Try via ssh iw dev wlanN del where N is your interface number (wlan2 in my case). It hangs for me in OpenWrt 22.03, but OpenWrt 21.02 and below passes ok.

@uberf0x
Copy link
Author

uberf0x commented Mar 7, 2023

Here is my OpenWrt Makefile:

include $(TOPDIR)/rules.mk

PKG_NAME:=rtl8188eu
PKG_RELEASE=1

STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
 
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define KernelPackage/rtl8188eu
  SUBMENU:=Wireless Drivers
  TITLE:=Driver for RTL8188EU Wireless Chipsets
  DEPENDS:= +kmod-cfg80211 +rtl8188eu-firmware +kmod-usb-core +@DRIVER_11N_SUPPORT
  FILES:=$(PKG_BUILD_DIR)/8188eu.ko
  AUTOLOAD:=$(call AutoProbe,8188eu)
  PROVIDES:=kmod-rtl8188eu
endef

NOSTDINC_FLAGS := \
	$(KERNEL_NOSTDINC_FLAGS) \
	-I$(PKG_BUILD_DIR) \
	-I$(PKG_BUILD_DIR)/include \
	-I$(STAGING_DIR)/usr/include/mac80211-backport \
	-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
	-I$(STAGING_DIR)/usr/include/mac80211 \
	-I$(STAGING_DIR)/usr/include/mac80211/uapi \
	-include backport/backport.h

CT_MAKEDEFS += CONFIG_RTL8188EU=m

NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT -D_LINUX_BYTEORDER_SWAB_H -DCONFIG_LITTLE_ENDIAN

define Build/Compile
	+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
	$(KERNEL_MAKE_FLAGS) \
	M="$(PKG_BUILD_DIR)" \
	NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
	$(CT_MAKEDEFS) modules
endef

$(eval $(call KernelPackage,rtl8188eu))

Also, the driver source requires some fixes to build against OpenWrt tree:

  1. rename include/linux/wireless.h to include/linux/old_unused_rtl_wireless.h
  2. rename include/autoconf.h to include/rtl_autoconf.h
  3. edit include/drv_conf.h:
    add #include <generated/autoconf.h>
    replace #include "autoconf.h" with #include "rtl_autoconf.h"
  4. edit Makefile (optional, depends on your device):
    replace CONFIG_PLATFORM_I386_PC = y with CONFIG_PLATFORM_I386_PC = n

@ValterMinute
Copy link

I managed to build the driver, now the device is detected and I can do a scan, but as soon as it tries to join a network it hangs. I am using openwrt 22.0.3 on an arm64 device.

Looks like the same issue i described above. When adding or modifying a network Openwrt internally executing delete and add a virtual wireless interface commands:

iw dev wlan2 del
iw phy phy2 interface add wlan2 type managed

Try via ssh iw dev wlanN del where N is your interface number (wlan2 in my case). It hangs for me in OpenWrt 22.03, but OpenWrt 21.02 and below passes ok.

Yes, it's exactly the same issue. I see that if I rmmod/insmod the driver the adapter is re-initialized, but not when it's stuck in that condition.
I am thinking about replacing iw dev del commands in the mac80211.sh script. In this way it will work with web UI and UCI, that is what I need ATM.

This is my makefile and patches, I think I solved the issues more or less in the same way you did.
I also tried to check other realtek drivers that have a similar structure to see if they solved the issue but, ATM, no luck.

Makefile.txt

001-fix-dev-del-issue.patch
000-fix-openwrt-build.patch

@ValterMinute
Copy link

ValterMinute commented Mar 8, 2023

I didn't test enough before posting this workaround, it still has issues if you change the adapter configuration.

Ok, I have a kind of nasty workaround for openwrt.
I changed /ib/netifd/wireless to unload/reload the module when iw dev del is called.
It relies on the fact that my interface is always named wlan1 so it probably won't work for many other people as it is, but can still be useful as a starting point and (hopefully) temporary workaround for people who stumble on this issue.

mac80211.sh.txt

@ValterMinute
Copy link

Second (hopefully better) attempt.
Issue is due to the fact that the driver does not support composite interfaces. iw dev del doesn't check this and the driver buggy implementation does the rest. Actually openwrt scripts expect iw dev del to fail in this case. I made a fix to not call iw dev del for my adapter. Probably a better fix would be to return an error on the call that removes the interface. I don't have time to look into this ATM.

mac80211.txt

@uberf0x
Copy link
Author

uberf0x commented Mar 10, 2023

Second (hopefully better) attempt. Issue is due to the fact that the driver does not support composite interfaces. iw dev del doesn't check this and the driver buggy implementation does the rest. Actually openwrt scripts expect iw dev del to fail in this case. I made a fix to not call iw dev del for my adapter. Probably a better fix would be to return an error on the call that removes the interface. I don't have time to look into this ATM.

mac80211.txt

After reading this post I came to the same conclusion about the need to patch the driver for error on delete interface attempt. Unfortunately i have not enough skills for this. But your solution modifying ash script is easy and efficient, thanks. Going to test it more, but seems everything works as it should. Except unknown signal quality and bitrate values for a connection in client mode, but seems it's Realtek and iwinfo compatibilty problem unrelated to the main issue.

@uberf0x
Copy link
Author

uberf0x commented Mar 10, 2023

Summing it up, the problem is not in OpenWrt, the problem is Realtek drivers do not support virtual interfaces. But for some reason their driver allows iw command to delete its interface. Which leads to unpredictable bugs depending on OpenWrt (kernel) version.
Until Realtek or someone else fix the driver we can use custom mac80211 posted above.

@uberf0x
Copy link
Author

uberf0x commented Mar 10, 2023

And more, maybe this will be useful for someone. As i wrote before this version of driver is the only that doesn't hang for earlier OpenWrt versions on iw dev del comparing to other repositories. I found the difference:
NOSTDINC_FLAGS += -DRTW_SINGLE_WIPHY
Building aircrack-ng or lwfinger driver with this option will fix hanging issue for OpenWrt 21.02 and below, but other problems remain anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants