morrownr / 88x2bu-20210702

Linux Driver for USB WiFi Adapters that are based on the RTL8812BU and RTL8822BU Chipsets - v5.13.1
Other
977 stars 177 forks source link

(solved) TP-Link Archer T4U ver.3 does not initialize? #104

Open jpap opened 1 year ago

jpap commented 1 year ago

I have a TP-Link Archer T4U ver.3 that was recently purchased. It works 100% under Windows, and I am trying to get it working on Linux.

I've tried VMs on amd64 (Linux kernel 5.15) and arm64 (Debian; Linux kernel 5.10), and a bare metal armv6l (kernel 5.15; Raspberry Pi B+): they all give the same result shown below.

Just in case, I tried it with a rtl8812au driver, and the device didn't register with the driver when plugged in; so it almost surely appears to be the BU chipset?

A full driver debug log is here. Perhaps the reason for the failure are the following two lines:
[  +0.000607] RTW: ERROR [HALMAC][ERR]test mode!!
[  +0.000002] RTW: ERROR rtl8822b_power_on: Power ON Fail!!
[  +4.363461] RTW: module init start
[  +0.000002] RTW: rtl88x2bu v5.13.1-20-gbd7c7eb9d.20210702_COEX20210316-18317b7b
[  +0.000001] RTW: rtl88x2bu BT-Coex version = COEX20210316-18317b7b
[  +0.000010] RTW: rtw_inetaddr_notifier_register
[  +0.000018] RTW: 
              usb_endpoint_descriptor(0):
[  +0.000001] RTW: bLength=7
[  +0.000000] RTW: bDescriptorType=5
[  +0.000000] RTW: bEndpointAddress=84
[  +0.000001] RTW: wMaxPacketSize=512
[  +0.000000] RTW: bInterval=0
[  +0.000001] RTW: RT_usb_endpoint_is_bulk_in = 4
[  +0.000000] RTW: 
              usb_endpoint_descriptor(1):
[  +0.000000] RTW: bLength=7
[  +0.000001] RTW: bDescriptorType=5
[  +0.000000] RTW: bEndpointAddress=5
[  +0.000000] RTW: wMaxPacketSize=512
[  +0.000001] RTW: bInterval=0
[  +0.000000] RTW: RT_usb_endpoint_is_bulk_out = 5
[  +0.000000] RTW: 
              usb_endpoint_descriptor(2):
[  +0.000001] RTW: bLength=7
[  +0.000000] RTW: bDescriptorType=5
[  +0.000000] RTW: bEndpointAddress=6
[  +0.000001] RTW: wMaxPacketSize=512
[  +0.000000] RTW: bInterval=0
[  +0.000000] RTW: RT_usb_endpoint_is_bulk_out = 6
[  +0.000001] RTW: 
              usb_endpoint_descriptor(3):
[  +0.000000] RTW: bLength=7
[  +0.000000] RTW: bDescriptorType=5
[  +0.000001] RTW: bEndpointAddress=87
[  +0.000000] RTW: wMaxPacketSize=64
[  +0.000000] RTW: bInterval=3
[  +0.000001] RTW: RT_usb_endpoint_is_int_in = 7, Interval = 3
[  +0.000000] RTW: 
              usb_endpoint_descriptor(4):
[  +0.000000] RTW: bLength=7
[  +0.000001] RTW: bDescriptorType=5
[  +0.000000] RTW: bEndpointAddress=8
[  +0.000000] RTW: wMaxPacketSize=512
[  +0.000001] RTW: bInterval=0
[  +0.000000] RTW: RT_usb_endpoint_is_bulk_out = 8
[  +0.000000] RTW: nr_endpoint=5, in_num=2, out_num=3

[  +0.000001] RTW: USB_SPEED_HIGH
[  +0.000001] RTW: CHIP TYPE: RTL8822B
[  +0.000018] RTW: [HALMAC]55772M
              HALMAC_MAJOR_VER = 1
              HALMAC_PROTOTYPE_VER = 6
              HALMAC_MINOR_VER = 6
              HALMAC_PATCH_VER = 23
[  +0.001397] RTW: [HALMAC][TRACE]halmac_init_adapter <===
[  +0.000001] RTW: [HALMAC][TRACE]phy_cfg_usb_8822b ===>
[  +0.000736] RTW: [HALMAC][TRACE]phy_cfg_usb_8822b <===
[  +0.000002] RTW: [HALMAC][TRACE]cfg_max_dl_size_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]Cfg max size:1000
[  +0.000001] RTW: [HALMAC][TRACE]cfg_max_dl_size_88xx <===
[  +0.000002] RTW: [HALMAC][TRACE]get_hw_value_8822b ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_hw_value_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_hw_value_88xx <===
[  +0.001338] RTW: Chip Version Info: CHIP_8822B_U4_2T2R_RomVer(3)
[  +0.000004] RTW: [HALMAC][TRACE]get_hw_value_8822b ===>
[  +0.000003] RTW: [HALMAC][TRACE]get_hw_value_88xx ===>
[  +0.000000] RTW: [HALMAC][TRACE]get_hw_value_88xx <===
[  +0.000002] RTW: config_chip_out_EP OutEpQueueSel(0x07), OutEpNumber(3)
[  +0.000462] RTW: [HALMAC][TRACE]get_log_efuse_size_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_log_efuse_size_88xx <===
[  +0.000002] RTW: [HALMAC][TRACE]dump_log_efuse_map_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]cfg = 1
[  +0.000001] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  +0.001557] RTW: [HALMAC][TRACE]set_hw_value_8822b ===>
[  +0.000002] RTW: [HALMAC][TRACE]set_hw_value_88xx ===>
[  +0.000936] RTW: [HALMAC][TRACE]set_hw_value_8822b <===
[  +0.595016] RTW: is_valid_id_status: HALMAC_FEATURE_DUMP_LOGICAL_EFUSE
[  +0.000003] RTW: [HALMAC][TRACE]dump_log_efuse_map_88xx <===
[  +0.000002] RTW: data[0] = 29
[  +0.000001] RTW: data[1] = 81
[  +0.000000] RTW: data[2] = 0
[  +0.000000] RTW: data[3] = 3c
[  +0.000001] RTW: data[4] = 9
[  +0.000000] RTW: data[5] = 0
[  +0.000001] RTW: data[6] = a1
[  +0.000000] RTW: data[7] = 0
[  +0.000000] RTW: data[8] = b6
[  +0.000001] RTW: data[9] = 4
[  +0.000000] RTW: data[a] = 64
[  +0.000000] RTW: data[b] = 10
[  +0.000001] RTW: data[c] = 0
[  +0.000000] RTW: data[d] = 0
[  +0.000000] RTW: data[e] = a3
[  +0.000001] RTW: data[f] = 0
[  +0.000000] RTW: data[10] = 31
[  +0.000001] RTW: data[11] = 32
[  +0.000000] RTW: data[12] = 33
[  +0.000000] RTW: data[13] = 34
[  +0.000001] RTW: data[14] = 34
[  +0.000000] RTW: data[15] = 34
[  +0.000000] RTW: data[16] = 2e
[  +0.000001] RTW: data[17] = 2e
[  +0.000000] RTW: data[18] = 2e
[  +0.000000] RTW: data[19] = 2e
[  +0.000001] RTW: data[1a] = 2e
[  +0.000000] RTW: data[1b] = 2
[  +0.000001] RTW: data[1c] = ee
[  +0.000000] RTW: data[1d] = ee
[  +0.000000] RTW: data[22] = 20
[  +0.000001] RTW: data[23] = 1e
[  +0.000000] RTW: data[24] = 1b
[  +0.000000] RTW: data[25] = 1a
[  +0.000001] RTW: data[26] = 18
[  +0.000000] RTW: data[27] = 17
[  +0.000001] RTW: data[28] = 16
[  +0.000000] RTW: data[29] = 15
[  +0.000000] RTW: data[2a] = 13
[  +0.000001] RTW: data[2b] = 13
[  +0.000000] RTW: data[2c] = 18
[  +0.000000] RTW: data[2d] = 16
[  +0.000001] RTW: data[2e] = 16
[  +0.000000] RTW: data[2f] = 16
[  +0.000000] RTW: data[30] = 15
[  +0.000001] RTW: data[31] = ee
[  +0.000000] RTW: data[34] = 0
[  +0.000001] RTW: data[35] = ff
[  +0.000000] RTW: data[36] = 20
[  +0.000000] RTW: data[37] = e0
[  +0.000001] RTW: data[3a] = 32
[  +0.000000] RTW: data[3b] = 32
[  +0.000000] RTW: data[3c] = 33
[  +0.000001] RTW: data[3d] = 33
[  +0.000000] RTW: data[3e] = 33
[  +0.000000] RTW: data[3f] = 33
[  +0.000001] RTW: data[40] = 2f
[  +0.000000] RTW: data[41] = 2e
[  +0.000001] RTW: data[42] = 2e
[  +0.000000] RTW: data[43] = 2e
[  +0.000000] RTW: data[44] = 2e
[  +0.000001] RTW: data[45] = 2
[  +0.000000] RTW: data[46] = ee
[  +0.000000] RTW: data[47] = 0
[  +0.000001] RTW: data[4c] = 21
[  +0.000000] RTW: data[4d] = 1f
[  +0.000001] RTW: data[4e] = 1d
[  +0.000000] RTW: data[4f] = 1c
[  +0.000000] RTW: data[50] = 19
[  +0.000001] RTW: data[51] = 19
[  +0.000000] RTW: data[52] = 18
[  +0.000000] RTW: data[53] = 18
[  +0.000001] RTW: data[54] = 17
[  +0.000000] RTW: data[55] = 17
[  +0.000000] RTW: data[56] = 1c
[  +0.000001] RTW: data[57] = 1b
[  +0.000000] RTW: data[58] = 1b
[  +0.000000] RTW: data[59] = 1b
[  +0.000001] RTW: data[5a] = 15
[  +0.000000] RTW: data[5b] = ee
[  +0.000001] RTW: data[5e] = 0
[  +0.000000] RTW: data[5f] = ff
[  +0.000000] RTW: data[60] = 20
[  +0.000001] RTW: data[61] = e0
[  +0.000000] RTW: data[b8] = a5
[  +0.000001] RTW: data[b9] = 3f
[  +0.000000] RTW: data[ba] = 1e
[  +0.000001] RTW: data[bb] = 0
[  +0.000000] RTW: data[c0] = ff
[  +0.000000] RTW: data[c1] = 9
[  +0.000001] RTW: data[c2] = 0
[  +0.000000] RTW: data[c3] = 11
[  +0.000000] RTW: data[c4] = 0
[  +0.000001] RTW: data[c5] = 0
[  +0.000000] RTW: data[c6] = 0
[  +0.000001] RTW: data[c7] = 0
[  +0.000000] RTW: data[c8] = 0
[  +0.000000] RTW: data[c9] = ff
[  +0.000001] RTW: data[ca] = 2
[  +0.000000] RTW: data[cb] = ff
[  +0.000000] RTW: data[cc] = ff
[  +0.000001] RTW: data[cd] = ff
[  +0.000000] RTW: data[100] = 57
[  +0.000001] RTW: data[101] = 23
[  +0.000000] RTW: data[102] = 15
[  +0.000000] RTW: data[103] = 1
[  +0.000001] RTW: data[104] = c1
[  +0.000000] RTW: data[105] = 67
[  +0.000001] RTW: data[106] = 2
[  +0.000000] RTW: data[107] = 98
[  +0.000000] RTW: data[108] = 48
[  +0.000001] RTW: data[109] = 27
[  +0.000000] RTW: data[10a] = eb
[  +0.000000] RTW: data[10b] = c5
[  +0.000001] RTW: data[10c] = e9
[  +0.000000] RTW: data[10d] = 9
[  +0.000000] RTW: data[10e] = 3
[  +0.000001] RTW: data[10f] = 52
[  +0.000000] RTW: data[110] = 65
[  +0.000001] RTW: data[111] = 61
[  +0.000000] RTW: data[112] = 6c
[  +0.000000] RTW: data[113] = 74
[  +0.000001] RTW: data[114] = 65
[  +0.000000] RTW: data[115] = 6b
[  +0.000000] RTW: data[116] = e
[  +0.000001] RTW: data[117] = 3
[  +0.000000] RTW: data[118] = 38
[  +0.000000] RTW: data[119] = 30
[  +0.000001] RTW: data[11a] = 32
[  +0.000000] RTW: data[11b] = 2e
[  +0.000001] RTW: data[11c] = 31
[  +0.000000] RTW: data[11d] = 31
[  +0.000000] RTW: data[11e] = 61
[  +0.000001] RTW: data[11f] = 63
[  +0.000000] RTW: data[120] = 20
[  +0.000000] RTW: data[121] = 4e
[  +0.000001] RTW: data[122] = 49
[  +0.000000] RTW: data[123] = 43
[  +0.000000] RTW: data[124] = 8
[  +0.000001] RTW: data[125] = 3
[  +0.000000] RTW: data[126] = 31
[  +0.000001] RTW: data[127] = 32
[  +0.000000] RTW: data[128] = 33
[  +0.000000] RTW: data[129] = 34
[  +0.000001] RTW: data[12a] = 35
[  +0.000000] RTW: data[12b] = 36
[  +0.000000] RTW: data[12c] = ff
[  +0.000001] RTW: data[12d] = ff
[  +0.000000] RTW: data[12e] = ff
[  +0.000001] RTW: data[12f] = ff
[  +0.000000] RTW: data[130] = ff
[  +0.000000] RTW: data[131] = ff
[  +0.000001] RTW: data[132] = ff
[  +0.000000] RTW: data[133] = ff
[  +0.000000] RTW: data[134] = ff
[  +0.000001] RTW: data[135] = ff
[  +0.000000] RTW: data[136] = ff
[  +0.000000] RTW: data[137] = ff
[  +0.000001] RTW: data[138] = ff
[  +0.000000] RTW: data[139] = ff
[  +0.000001] RTW: data[13a] = ff
[  +0.000000] RTW: data[13b] = ff
[  +0.000000] RTW: data[13c] = ff
[  +0.000001] RTW: data[13d] = ff
[  +0.000000] RTW: data[13e] = ff
[  +0.000000] RTW: data[13f] = ff
[  +0.000001] RTW: data[140] = 33
[  +0.000000] RTW: data[141] = a
[  +0.000000] RTW: data[142] = 1f
[  +0.000001] RTW: data[143] = 1
[  +0.000000] RTW: data[144] = 0
[  +0.000001] RTW: data[145] = 0
[  +0.000000] RTW: data[146] = 21
[  +0.000000] RTW: data[147] = f
[  +0.000003] RTW: [HALMAC][TRACE]get_log_efuse_size_88xx ===>
[  +0.000000] RTW: [HALMAC][TRACE]get_log_efuse_size_88xx <===
[  +0.000001] RTW: HW EFUSE
[  +0.000002] RTW: 0x000: 29 81 00 3C  09 00 A1 00  B6 04 64 10  00 00 A3 00  
[  +0.000005] RTW: 0x010: 31 32 33 34  34 34 2E 2E  2E 2E 2E 02  EE EE FF FF  
[  +0.000005] RTW: 0x020: FF FF 20 1E  1B 1A 18 17  16 15 13 13  18 16 16 16  
[  +0.000005] RTW: 0x030: 15 EE FF FF  00 FF 20 E0  FF FF 32 32  33 33 33 33  
[  +0.000004] RTW: 0x040: 2F 2E 2E 2E  2E 02 EE 00  FF FF FF FF  21 1F 1D 1C  
[  +0.000005] RTW: 0x050: 19 19 18 18  17 17 1C 1B  1B 1B 15 EE  FF FF 00 FF  
[  +0.000005] RTW: 0x060: 20 E0 FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x070: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x080: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x090: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x0A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x0B0: FF FF FF FF  FF FF FF FF  A5 3F 1E 00  FF FF FF FF  
[  +0.000005] RTW: 0x0C0: FF 09 00 11  00 00 00 00  00 FF 02 FF  FF FF FF FF  
[  +0.000004] RTW: 0x0D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x0E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x0F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x100: 57 23 15 01  C1 67 02 98  48 27 EB C5  E9 09 03 52  
[  +0.000005] RTW: 0x110: 65 61 6C 74  65 6B 0E 03  38 30 32 2E  31 31 61 63  
[  +0.000005] RTW: 0x120: 20 4E 49 43  08 03 31 32  33 34 35 36  FF FF FF FF  
[  +0.000004] RTW: 0x130: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x140: 33 0A 1F 01  00 00 21 0F  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x150: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x160: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x170: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x180: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x190: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x1A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x1B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x1C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x1D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x1E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x1F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x200: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x210: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x220: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x230: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x240: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x250: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x260: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x270: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x280: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x290: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x2A0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x2B0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x2C0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x2D0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000004] RTW: 0x2E0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000005] RTW: 0x2F0: FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  
[  +0.000006] RTW: EEPROM ID = 0x8129
[  +0.000001] RTW: EEPROM Version = 0
[  +0.000001] RTW: EEPROM Regulatory=0x01
[  +0.000000] RTW: EEPROM Board Type=0x00
[  +0.000001] RTW: EEPROM Disable BT-coex, ant_num=1
[  +0.000001] RTW: hal_com_config_channel_plan chplan:0x25
[  +0.000000] RTW: EEPROM crystal_cap=0x3f
[  +0.000001] RTW: EEPROM ThermalMeter=0x1e
[  +0.000000] RTW: EEPROM Customer ID=0x00
[  +0.000000] RTW: EEPROM SupportRemoteWakeup=0
[  +0.000001] RTW: EEPROM PAType_2G is 0x0, ExternalPA_2G = 0
[  +0.000000] RTW: EEPROM PAType_5G is 0x0, external_pa_5g = 0
[  +0.000001] RTW: EEPROM LNAType_2G is 0x0, ExternalLNA_2G = 0
[  +0.000000] RTW: EEPROM LNAType_5G is 0x0, external_lna_5g = 0
[  +0.000000] RTW: EEPROM TypeGPA = 0x0
[  +0.000001] RTW: EEPROM TypeAPA = 0x0
[  +0.000000] RTW: EEPROM TypeGLNA = 0x0
[  +0.000000] RTW: EEPROM TypeALNA = 0x0
[  +0.000001] RTW: EEPROM rfe_type=0x2
[  +0.000000] RTW: [HALMAC][TRACE]get_efuse_size_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_efuse_size_88xx <===
[  +0.000000] RTW: [HALMAC][TRACE]get_efuse_size_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_efuse_size_88xx <===
[  +0.000001] RTW: [HALMAC][TRACE]dump_efuse_map_88xx ===>
[  +0.000000] RTW: [HALMAC][TRACE]cfg = 1
[  +0.000001] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  +0.000315] RTW: is_valid_id_status: HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE
[  +0.000017] RTW: [HALMAC][TRACE]dump_efuse_map_88xx <===
[  +0.000002] RTW: EEPROM efuse[0x3D7]=0xf2
[  +0.000000] RTW: EEPROM efuse[0x3D8]=0xf0
[  +0.000001] RTW: EEPROM USB Switch=1
[  +0.000001] RTW: EEPROM VID = 0x2357, PID = 0x0115
[  +0.000003] RTW: [HALMAC][TRACE]pre_init_system_cfg_8822b ===>
[  +0.008220] RTW: [HALMAC][TRACE]set_hw_value_88xx ===>
[  +0.002795] RTW: [HALMAC][TRACE]set_hw_value_88xx <===
[  +0.000607] RTW: ERROR [HALMAC][ERR]test mode!!
[  +0.000002] RTW: ERROR rtl8822b_power_on: Power ON Fail!!
[  +0.000336] RTW: rtl8822b_fw_dl fw source from array
[  +0.000003] RTW: [HALMAC][TRACE]pre_init_system_cfg_8822b ===>
[  +0.003693] RTW: [HALMAC][TRACE]set_hw_value_88xx ===>
[  +0.003934] RTW: [HALMAC][TRACE]set_hw_value_88xx <===
[  +0.000450] RTW: ERROR [HALMAC][ERR]test mode!!
[  +0.000002] RTW: ERROR rtl8822b_power_on: Power ON Fail!!
[  +0.000001] RTW: ERROR rtl8822b_fw_dl Download Firmware from array failed
[  +0.000389] RTW: hal_read_mac_hidden_rpt Fail! (0, 20ms), fwdl:0, id:0xfd
[  +0.000004] RTW: [HALMAC][TRACE]get_efuse_size_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]get_efuse_size_88xx <===
[  +0.000002] RTW: [HALMAC][TRACE]dump_efuse_map_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]cfg = 1
[  +0.000001] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  +0.000936] RTW: is_valid_id_status: HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE
[  +0.000003] RTW: [HALMAC][TRACE]dump_efuse_map_88xx <===
[  +0.000004] RTW: [HALMAC][TRACE]get_efuse_size_88xx ===>
[  +0.000002] RTW: [HALMAC][TRACE]get_efuse_size_88xx <===
[  +0.000002] RTW: [HALMAC][TRACE]dump_efuse_map_88xx ===>
[  +0.000000] RTW: [HALMAC][TRACE]cfg = 1
[  +0.000001] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  +0.001395] RTW: is_valid_id_status: HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE
[  +0.000002] RTW: [HALMAC][TRACE]dump_efuse_map_88xx <===
[  +0.000003] RTW: [HALMAC][TRACE]get_efuse_size_88xx ===>
[  +0.000000] RTW: [HALMAC][TRACE]get_efuse_size_88xx <===
[  +0.000001] RTW: [HALMAC][TRACE]dump_efuse_map_88xx ===>
[  +0.000001] RTW: [HALMAC][TRACE]cfg = 1
[  +0.000001] RTW: ERROR [HALMAC][ERR]Dump efuse in suspend
[  +0.000639] RTW: is_valid_id_status: HALMAC_FEATURE_DUMP_PHYSICAL_EFUSE
[  +0.000001] RTW: [HALMAC][TRACE]dump_efuse_map_88xx <===
[  +0.000002] RTW: rtw_hal_read_chip_info in 620 ms
[  +0.000006] RTW: [RF_PATH] ver_id.RF_TYPE:RF_2T2R
[  +0.000000] RTW: [RF_PATH] HALSPEC's rf_reg_trx_path_bmp:0x33, rf_reg_path_avail_num:2, max_tx_cnt:2
[  +0.000001] RTW: [RF_PATH] PG's trx_path_bmp:0x00, max_tx_cnt:0
[  +0.000001] RTW: [RF_PATH] Registry's trx_path_bmp:0x00, tx_path_lmt:0, rx_path_lmt:0
[  +0.000000] RTW: [RF_PATH] HALDATA's trx_path_bmp:0x33, max_tx_cnt:2
[  +0.000000] RTW: [RF_PATH] HALDATA's rf_type:RF_2T2R, NumTotalRFPath:2
[  +0.000001] RTW: rtw_hal_rfpath_init trx_path_bmp:0x33(RF_2T2R), NumTotalRFPath:2, max_tx_cnt:2
[  +0.000001] RTW: [TRX_Nss] HALSPEC - tx_nss:2, rx_nss:2
[  +0.000000] RTW: [TRX_Nss] Registry - tx_nss:0, rx_nss:0
[  +0.000001] RTW: [TRX_Nss] HALDATA - tx_nss:2, rx_nss:2
[  +0.000000] RTW: rtw_hal_trxnss_init tx_nss:2, rx_nss:2
[  +0.000014] RTW: txpath=0x3, rxpath=0x3
[  +0.000000] RTW: txpath_1ss:0x1, num:1
[  +0.000001] RTW: txpath_2ss:0x3, num:2
[  +0.000041] RTW: init_mlme_default_rate_set: support OFDM
[  +0.000104] RTW: NR_RECVBUFF: 8, recvbuf_nr: 8
[  +0.000000] RTW: MAX_RECVBUF_SZ: 32768
[  +0.000001] RTW: NR_PREALLOC_RECV_SKB: 8
[  +0.000121] RTW: rtw_alloc_macid((null)) if1, mac_addr:ff:ff:ff:ff:ff:ff macid:1
[  +0.000001] RTW: rtw_init_pwrctrl_priv: IPS_mode=1, LPS_mode=1, LPS_level=0
[  +0.000300] RTW: IQK FW offload:enable
[  +0.000003] RTW: init_phydm_cominfo: Fv=1 Cv=3
[  +0.000063] RTW: rtw_regsty_chk_target_tx_power_valid return _FALSE for band:0, path:0, rs:0, t:-1
[  +0.000018] RTW: phy_ConfigBBWithPgParaFile(): No File PHY_REG_PG.txt, Load from HWImg Array!
[  +0.000007] RTW: default power by rate loaded
[  +0.000005] RTW: init_channel_set_from_rtk_priv((null)) ChannelPlan ID:0x25, ch num:24
[  +0.000004] RTW: RM: rtw_init_rm
[  +0.000002] RTW: can't get autopm:
[  +0.000002] RTW: rtw_macaddr_cfg mac addr:98:48:27:eb:c5:e9
[  +0.000002] RTW: bDriverStopped:True, bSurpriseRemoved:False, bup:0, hw_init_completed:0
[  +0.000034] RTW: rtw_cfg80211_init_wiphy_band:rf_type=2
[  +0.000008] RTW: rtw_wiphy_alloc(phy1)
[  +0.000009] RTW: rtw_wdev_alloc(padapter=00000000a17348a1)
[  +0.000001] RTW: rtw_wiphy_register(phy1)
[  +0.000001] RTW: Register RTW cfg80211 vendor cmd(0x67) interface
[  +0.000133] RTW: rtw_reg_notifier(phy1)
[  +0.000001] RTW: initiator:CORE, wiphy_idx:-1, type:USER
[  +0.000001] RTW: alpha2:00
[  +0.000000] RTW: dfs_region:UNSET
[  +0.000001] RTW: intersect:0
[  +0.000001] RTW: processed:1
[  +0.000000] RTW: country_ie_env:ANY
[  +0.000070] RTW: rtw_ndev_init(wlan0) if1 mac_addr=98:48:27:eb:c5:e9
[  +0.000059] RTW: rtw_ndev_notifier_call(wlan0) state:17
[  +0.000226] RTW: cfg80211_rtw_get_txpower(wlan0) total max: -10000 mbm
[  +0.000003] RTW: rtw_ndev_notifier_call(wlan0) state:5
[  +0.000044] usbcore: registered new interface driver rtl88x2bu
[  +0.000002] RTW: module init ret=0
[  +0.004131] rtl88x2bu 2-3:1.0 wlx984827ebc5e9: renamed from wlan0
[  +0.016033] RTW: rtw_ndev_notifier_call(wlx984827ebc5e9) state:11
[Dec 8 12:55] RTW: rtw_ndev_notifier_call(wlx984827ebc5e9) state:14
[  +0.000003] RTW: _netdev_open(wlx984827ebc5e9) , bup=0
[  +0.000002] RTW: rtl8822b_hal_init fw source from array
[  +0.000003] RTW: [HALMAC][TRACE]pre_init_system_cfg_8822b ===>
[  +0.003753] RTW: [HALMAC][TRACE]set_hw_value_88xx ===>
[  +0.001968] RTW: [HALMAC][TRACE]set_hw_value_88xx <===
[  +0.000330] RTW: ERROR [HALMAC][ERR]test mode!!
[  +0.000002] RTW: ERROR rtl8822b_power_on: Power ON Fail!!
[  +0.000001] RTW: ERROR rtl8822b_hal_init Download Firmware from array failed
[  +0.000002] RTW: [HALMAC][TRACE]pinmux_set_func_8822b ===>
[  +0.000000] RTW: [HALMAC][TRACE]func name : 0
[  +0.000001] RTW: [HALMAC][TRACE]chk_pinmux_valid func : 0 status : 0
[  +0.001080] RTW: [HALMAC][TRACE]pinmux_set_func_8822b <===
[  +0.000002] RTW: [HALMAC][TRACE]pinmux_wl_led_mode_88xx ===>
[  +0.000766] RTW: [HALMAC][TRACE]pinmux_wl_led_mode_88xx <===
[  +0.000002] RTW: rtl8822bu_init in 8ms
[  +0.000004] RTW: rtw_hal_set_macaddr_port wlx984827ebc5e9- hw port(0) mac_addr =98:48:27:eb:c5:e9
[  +0.000001] RTW: [HALMAC][TRACE]cfg_mac_addr_88xx ===>
[  +0.000529] RTW: [HALMAC][TRACE]cfg_mac_addr_88xx <===
[  +0.000832] RTW: [HW_VAR_ENABLE_RX_BAR] 0x6A2=0xEAEA
[  +0.000004] RTW: (Channel <= 14) && (Channel >=1) but wireless_mode do not support 2.4G
[  +0.000353] RTW: [HALMAC][TRACE]cfg_net_type_88xx ===>
[  +0.000335] RTW: [HALMAC][TRACE]cfg_net_type_88xx <===
[  +0.000002] RTW: set_opmode_port0(wlx984827ebc5e9): hw_port(0) mode=2
[  +0.000001] RTW: StopTxBeacon
[  +0.001739] RTW: rtw_hal_init: padapter->registrypriv.set_rrsr_value=0xffffffff
[  +0.000003] RTW: MAC Address = 98:48:27:eb:c5:e9
[  +0.000009] RTW: -871x_drv - drv_open, bup=1
[  +0.000071] RTW: cfg80211_rtw_set_power_mgmt(wlx984827ebc5e9) enabled:1, timeout:-1
[  +0.000001] RTW: rtw_ndev_notifier_call(wlx984827ebc5e9) state:1
[  +0.000013] IPv6: ADDRCONF(NETDEV_CHANGE): wlx984827ebc5e9: link becomes ready
[  +0.000016] RTW: rtw_inet6addr_notifier_call: up IPv6 addrs: fe80:0000:0000:0000:9a48:27ff:feeb:c5e9
[  +0.000019] RTW: rtw_ndev_notifier_call(wlx984827ebc5e9) state:4

The README.md recommended dump is here.
# uname -mr; mokutil --sb-state; lsusb; rfkill list all; dkms status; iw dev; iw reg get
5.10.0-19-amd64 x86_64
EFI variables are not supported on this system
Bus 002 Device 003: ID 2357:0115 TP-Link Archer T4U ver.3
Bus 002 Device 002: ID 203a:fffc PARALLELS Virtual Mouse
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 203a:fff9 PARALLELS HD Pro Webcam C920
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
1: phy1: Wireless LAN
    Soft blocked: no
    Hard blocked: no
rtl88x2bu, 5.13.1, 5.10.0-19-amd64, x86_64: installed
phy#1
    Interface wlx984827ebc5e9
        ifindex 4
        wdev 0x100000001
        addr 98:48:27:eb:c5:e9
        type managed
        txpower -100.00 dBm
global
country US: DFS-FCC
    (902 - 904 @ 2), (N/A, 30), (N/A)
    (904 - 920 @ 16), (N/A, 30), (N/A)
    (920 - 928 @ 8), (N/A, 30), (N/A)
    (2400 - 2472 @ 40), (N/A, 30), (N/A)
    (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
    (5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
    (5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
    (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
    (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
    (57240 - 71000 @ 2160), (N/A, 40), (N/A)

While I can see the network interface, I can't run a scan (nothing else works).

# iw dev wlx984827ebc5e9 scan
command failed: Operation not permitted (-1)

# ifconfig 
enp0s5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.211.55.8  netmask 255.255.255.0  broadcast 10.211.55.255
        inet6 fdb2:2c26:d4e1:0:25d:41ff:fe07:486f  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::21c:42ff:fe02:482f  prefixlen 64  scopeid 0x20<link>
        ether 00:1c:42:02:48:2f  txqueuelen 1000  (Ethernet)
        RX packets 1408  bytes 361880 (353.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 908  bytes 202225 (197.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlx984827ebc5e9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::9a48:27ff:feeb:c5e9  prefixlen 64  scopeid 0x20<link>
        ether 98:48:27:eb:c5:e9  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 12 overruns 0  c

Appreciate any advice. :)

jpap commented 1 year ago

This is where the first failure happens:

https://github.com/morrownr/88x2bu-20210702/blob/2590672d717e2516dd2e96ed66f1037a6815bced/hal/halmac/halmac_88xx/halmac_8822b/halmac_init_8822b.c#L991-L994

jpap commented 1 year ago

If I comment out line 993 above, it works! :D Perhaps this hardware revision changed the definitions of the bits in that register?

morrownr commented 1 year ago

Hi @jpap

Interesting. This is a new one on me. Run it for a while with the line commented out and see what happens. I'd like to know.

By the way, the approval was given today for the new in-kernel driver for this chipset to be mainlined. I'm not sure if it will make it into 6.2 or 6.3 but there is something to be excited about going on. Imagine not having to compile a driver.

jpap commented 1 year ago

It's been very stable. I've been running it as an AP client for the past week 24/7 and have had no problems. When the Raspberry Pi reboots, it always comes back up and associates.

morrownr commented 1 year ago

Hi @jpap

That is good news. I think I am going to borrow your fix above and see what happens on other adapters. In looking at the code, it does not seem necessary for that code to exist anyway but we'll see. Thanks.

Nick

jpap commented 1 year ago

My guess is that the check is there to just make sure the adapter is responding to the commands issued to it before issuing more for that mode.

It might be that with my device they changed the register value, dropped it entirely (no other driver code reads or writes that register), or there’s a race condition for that value to be valid. I am getting a second T4U for another use case, now that it works with Linux, and will see if that exhibits the same behaviour.

If there’s time, I’ll add a sleep or delay to see if the problem is caused by a race, or confirm if the hardware registers were changed in that silicon revision.

Thank you otherwise for your maintenance work and quick responses to these issues. I would’ve had a paperweight on my hands otherwise!

morrownr commented 1 year ago

@jpap

Response much appreciated. I would appreciate information from your further testing so as to note it here. If you can't find anything and want to submit a PR, that would be fine.

I am getting a second T4U for another use case, now that it works with Linux...

A couple of things to point out to you:

https://github.com/morrownr/USB-WiFi

Menu items 1 and 2 give a lot of information about wifi adapters and use on Linux. Keep in mind that there are adapters with the new mt7921au chipset available and it is WiFi 6e capable. It is very fast on 5 GHz in AC mode. Still testing WiFi 6 and WiFi 6e.

I plan to test once 6.2 rc1 is released here in a couple of weeks. I don't know about the quality yet.

Nick

jpap commented 1 year ago

My second device (the same brand/model) arrived by mail today... and it works without the above patch!

Given that my first device worked under Windows without any issues, I'm not convinced it is a hardware problem per-se. It could be a different revision of the silicon (I haven't opened them up, because I don't want to destroy the bottom sticker and void the warranty), or maybe it is indeed a race condition in the driver.

Since a) my "buggy device" works fine for an extended period with the change outlined above, b) the register was not written to, and c) the register doesn't appear anywhere else in the driver, I'd be inclined to recommend making that change permanently for everyone.

If I get a chance, I'll add a spin/sleep to confirm or rule out the race condition idea; but I might not be able to do that for some time as that device is running remotely at present.

Please close this issue, along with a commit or not, as you feel. I'd also be happy to submit a PR and do it that way if you prefer.

morrownr commented 1 year ago

Since a) my "buggy device" works fine for an extended period with the change outlined above, b) the register was not written to, and c) the register doesn't appear anywhere else in the driver, I'd be inclined to recommend making that change permanently for everyone.

No need to submit a PR. I've already made the change locally and will push it later today. Thanks for investigating.