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

WLAN0 had shown but network is down #157

Closed
briansune opened this issue Jul 25, 2023 · 107 comments
Closed

WLAN0 had shown but network is down #157

briansune opened this issue Jul 25, 2023 · 107 comments

Comments

@briansune
Copy link

wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether ff:ff:ff:ff:ff:ff 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 0 overruns 0 carrier 0 collisions 0

wlan0 Interface doesn't support scanning : Network is down

sit0 Interface doesn't support scanning.

lo Interface doesn't support scanning.

Had tried nmcli radio wifi on and restart service.

Module Size Used by
rtw_8723ds 16384 0
rtw_8723d 45056 1 rtw_8723ds
rtw_sdio 20480 1 rtw_8723ds
rtw_core 151552 2 rtw_sdio,rtw_8723d

@lwfinger
Copy link
Owner

Bringing your interface up is not the driver's responsibility. That is done by your user-space network control software. What are you using? I recommend NetworkManager. It Just Works.

@briansune
Copy link
Author

briansune commented Jul 25, 2023

Do you mean the driver is working?
This is a cross-compiled insert module method.

I am using networkmanager

`
Docs: man:NetworkManager(8)
Main PID: 498 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
└─498 /usr/sbin/NetworkManager --no-daemon

Jul 26 02:08:52 localhost.localdomain NetworkManager[498]:
[1690308532.0498] Error: failed to open /run/network/ifstate
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]: [1690308532.0
960] modem-manager: ModemManager available
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]: [1690308532.0
969] supplicant: wpa_supplicant running
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]: [1690308532.0
973] device (wlan0): supplicant interface state: init -> starting
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]:
[1690308532.1108] sup-iface[0x633538,wlan0]: error adding interface:
wpa_supplicant couldn't grab this interface.
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]: [1690308532.1
110] device (wlan0): supplicant interface state: starting -> down
Jul 26 02:08:52 localhost.localdomain NetworkManager[498]: [1690308532.1
115] manager: startup complete
Jul 26 02:09:02 localhost.localdomain NetworkManager[498]:
39m [1690308542.4543] device (wlan0): re-acquiring supplicant interface (
#1).
Jul 26 02:09:02 localhost.localdomain NetworkManager[498]:
31m [1690308542.4711] sup-iface[0x6335a0,wlan0]: error adding interface:
wpa_supplicant couldn't grab this interface.
Jul 26 02:09:02 localhost.localdomain NetworkManager[498]: [1690308542.4
713] device (wlan0): supplicant interface state: starting -> down
`

@briansune
Copy link
Author

Let me attach the dmesg:

[ 99.221393] rtw_core: loading out-of-tree module taints kernel.
[ 110.501543] rtw_8723ds mmc1:0001:1: Firmware version 48.0.0, H2C version 0

@RadxaYuntian
Copy link
Contributor

RadxaYuntian commented Nov 2, 2023

I'm also having this issue. The wired thing is I did have this working before on 8723DS :/ I also have ff:ff:ff:ff:ff:ff as MAC address, and I tried both iwd and wpa_supplicant as NetworkManager backend on Debian 12. None of them helps.

iwd
radxa@rock-pi-s:~$ sudo journalctl -u iwd | cat
Nov 02 17:37:25 rock-pi-s systemd[1]: Starting iwd.service - Wireless service...
Nov 02 17:37:26 rock-pi-s iwd[538]: Wireless daemon version 2.3
Nov 02 17:37:26 rock-pi-s iwd[538]: Loaded configuration from /etc/iwd/main.conf
Nov 02 17:37:26 rock-pi-s systemd[1]: Started iwd.service - Wireless service.
Nov 02 17:37:26 rock-pi-s iwd[538]: station: Network configuration is disabled.
Nov 02 17:37:26 rock-pi-s iwd[538]: Wiphy: 0, Name: phy0
Nov 02 17:37:26 rock-pi-s iwd[538]:         Permanent Address: ff:ff:ff:ff:ff:ff
Nov 02 17:37:26 rock-pi-s iwd[538]:         2.4Ghz Band:
Nov 02 17:37:26 rock-pi-s iwd[538]:                 Bitrates (non-HT):
Nov 02 17:37:26 rock-pi-s iwd[538]:                          1.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                          2.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                          5.5 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         11.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                          6.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                          9.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         12.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         18.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         24.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         36.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         48.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                         54.0 Mbps
Nov 02 17:37:26 rock-pi-s iwd[538]:                 HT Capabilities:
Nov 02 17:37:26 rock-pi-s iwd[538]:                         HT40
Nov 02 17:37:26 rock-pi-s iwd[538]:                         Short GI for 20Mhz
Nov 02 17:37:26 rock-pi-s iwd[538]:                         Short GI for 40Mhz
Nov 02 17:37:26 rock-pi-s iwd[538]:                 HT RX MCS indexes:
Nov 02 17:37:26 rock-pi-s iwd[538]:                         0-7
Nov 02 17:37:26 rock-pi-s iwd[538]:                         32
Nov 02 17:37:26 rock-pi-s iwd[538]:         Ciphers: BIP-CMAC-256 BIP-GMAC-256 BIP-GMAC-128 CCMP-256
Nov 02 17:37:26 rock-pi-s iwd[538]:                  GCMP-256 GCMP-128 BIP-CMAC-128 CCMP-128
Nov 02 17:37:26 rock-pi-s iwd[538]:                  TKIP
Nov 02 17:37:26 rock-pi-s iwd[538]:         Supported iftypes: ad-hoc station ap
Nov 02 17:37:26 rock-pi-s iwd[538]: Wiphy phy0 will only use the default interface
Nov 02 17:37:26 rock-pi-s iwd[538]: Error bringing interface 3 up: Cannot assign requested address
dmesg with debug_mask == -1
[  991.996901] rtw_8723ds mmc2:0001:1: rtw88 SDIO probe: vendor=0x024c device=d723 class=ff
[  991.997188] rtw_8723ds mmc2:0001:1: Firmware version 48.0.0, H2C version 0
[  992.315527] rtw_8723ds mmc2:0001:1: hw cap: hci=0x06, bw=0x03, ptcl=0x02, ant_num=2, nss=1
[  992.315570] rtw_8723ds mmc2:0001:1: use rfe_def[0]
[  992.317161] rtw_8723ds mmc2:0001:1: use rfe_def[0]
[  992.317176] rtw_8723ds mmc2:0001:1: phy cond=0x0304f400
[  992.317231] rtw_8723ds mmc2:0001:1: txpwr regd 3 does not be configured
[  992.317243] rtw_8723ds mmc2:0001:1: cfg txpwr regd 3 by regd 0 as alternative
[  992.317262] rtw_8723ds mmc2:0001:1: txpwr regd 4 does not be configured
[  992.317274] rtw_8723ds mmc2:0001:1: cfg txpwr regd 4 by regd 2 as alternative
[  992.317294] rtw_8723ds mmc2:0001:1: txpwr regd 5 does not be configured
[  992.317305] rtw_8723ds mmc2:0001:1: cfg txpwr regd 5 by regd 2 as alternative
[  992.317325] rtw_8723ds mmc2:0001:1: txpwr regd 6 does not be configured
[  992.317337] rtw_8723ds mmc2:0001:1: cfg txpwr regd 6 by regd 0 as alternative
[  992.317357] rtw_8723ds mmc2:0001:1: txpwr regd 7 does not be configured
[  992.317368] rtw_8723ds mmc2:0001:1: cfg txpwr regd 7 by regd 2 as alternative
[  992.317388] rtw_8723ds mmc2:0001:1: txpwr regd 8 does not be configured
[  992.317400] rtw_8723ds mmc2:0001:1: cfg txpwr regd 8 by regd 0 as alternative
[  992.317420] rtw_8723ds mmc2:0001:1: txpwr regd 9 does not be configured
[  992.317430] rtw_8723ds mmc2:0001:1: cfg txpwr regd 9 by regd 2 as alternative
[  992.317631] rtw_8723ds mmc2:0001:1: regd init state 0: apply alpha2 00, regd {10, 10}, dfs_region 0
[  992.318698] rtw_8723ds mmc2:0001:1: regd state: 0 -> 0
[  992.318741] rtw_8723ds mmc2:0001:1: get alpha2 00 from initiator 0: apply alpha2 00, regd {10, 10}, dfs_region 0

Edit: rtl8723ds worked on the same hardware and system.

@briansune
Copy link
Author

@RadxaYuntian

I am not sure the root cause but what I had discussed with @lwfinger is that the RTW88 have not default firmware loading when IC is not fused with a firmware and this is my case.

The board hardware is fully custom and IC is not from OEM or broker, which causes the IC is not fused with any default firmware.
@lwfinger I am not sure you had update the driver with a default firmware like rtl8723ds old repository or not?

BR
Brian

@RadxaYuntian
Copy link
Contributor

The board hardware is fully custom and IC is not from OEM or broker, which causes the IC is not fused with any default firmware.

Same thing here. We are a SBC manufacturer and the affected is one of our product.

I don't quite understand what you mean by firmware. From dmesg it appears to be loaded: Firmware version 48.0.0, H2C version 0. I assume it is using /lib/firmware/rtw88/rtw8723d_fw.bin.

I think you might mean eFUSE. I'll take a look at related code as well.

@briansune
Copy link
Author

@RadxaYuntian

Opps typo, it should be IC settings aka EFUSE not firmware.
The EFUSE is controlling the TX LUT power and DCDC, XTAL settings.

You are right eFUSE is what I am discussing.

BR

@briansune
Copy link
Author

@RadxaYuntian

Why I will discuss @lwfinger with the EFUSE setting is because the XTAL is mostly the case along side with the DCDC.
If XTAL is not aligned with the EFUSE then the WIFI 100% won't work.
If DCDC is not aligned with EFUSE, the voltage you can measure is off the normal range.
Either way will cause the WIFI chip not working, so as long as RTW88 is not update there are not way it could happen.

BR

@lwfinger
Copy link
Owner

lwfinger commented Nov 2, 2023

I looked into providing a default EFUSE when it is not programmed, but I got diverted. If the MAC address is all ones, the EFUSE is not programmed.

@briansune
Copy link
Author

@lwfinger

Yes, if all ones are shown then EFUSE is not preloaded for the IC. Then the driver need to take place to preload a default one which the old RTL8723DS had provided. But RTW88 does not, which you need to update or extract those from the old repository.

BR

@briansune
Copy link
Author

@lwfinger

I am afraid I don't have that ability to transfer the old driver to the new old. I am mostly hardware engineer so this is really out of my scope and I would like to.

=S

@RadxaYuntian
Copy link
Contributor

I see there is Efuse_Read1ByteFromFakeContent in rtl8723ds, but I did not find where fakeEfuseContent got initialized. It appears it has a default value of all 0 and then memset to all 0xFF, and neither looks like some real eFuse data.

@briansune
Copy link
Author

@RadxaYuntian

My method to see the EFUSE is using old RTL8723DS repository and make the debug flag to 4 and during driver load there is a series of message that shown the EFUSE are all ZERO and then it will say loading a default one.

@RadxaYuntian
Copy link
Contributor

Thanks for the hint. I have located Hal_InitPGData for detecting invalid eFuse and then a bunch of parse functions. An example of falling back to driver defaults can be found in hal_load_pg_txpwr_info for loading TX LUT.

I'll see what will happen if I inject them in rtw88's rtw8723d_read_efuse.

@briansune
Copy link
Author

@RadxaYuntian

Great, would be nice to push back to this repository.

@RadxaYuntian
Copy link
Contributor

Spent last 2 days on this hack: radxa-pkg@9d2ffb5

Current status and insight learnt:

  • Must assign a valid MAC address in efuse->addr. All zero or all 0xFF address will be accepted by the system as-is, and NetworkManager won't generate random address for those, so the device cannot be brought up. Wasted a lot of time on this.
  • Device specific and generic pg_txpwr_def_info extracted from rtl8723ds both allows the chip to start, even when combined.
  • The device currently appears to allow regulatory region changed (via iw reg set) and can scan and list Wi-Fi networks (via nmcli device wifi rescan/list). The discovered networks are much fewer than what's available, and I haven't been able to get it connected:
[  947.839160] wlan0: authenticate with c8:3a:35:9e:43:61
[  947.839258] wlan0: 80 MHz not supported, disabling VHT
[  948.570820] wlan0: send auth to c8:3a:35:9e:43:61 (try 1/3)
[  949.844179] wlan0: send auth to c8:3a:35:9e:43:61 (try 2/3)
[  950.836181] wlan0: send auth to c8:3a:35:9e:43:61 (try 3/3)
[  951.828260] wlan0: authentication with c8:3a:35:9e:43:61 timed out

I think to fix it is currently beyond my scope, so we will have to use rtl8723ds in the mean time.

@briansune
Copy link
Author

@RadxaYuntian

Do a manual MAC assign make the LO lock?
And able to scan WIFI?
If a scan is able to get WIFI device then this is much easy to fix otherwise it is just back to beginning.

@RadxaYuntian
Copy link
Contributor

Do a manual MAC assign make the LO lock?

I'm not sure what you mean by LO lock. Also I did not try assigning MAC from user space. The MAC address was hardcoded in the driver for now.

And able to scan WIFI?

Yes, albeit much less that what is available here.

@briansune
Copy link
Author

briansune commented Nov 8, 2023

@RadxaYuntian

So the updated driver can work?
Could you forward and let me give it a try and see the different?
Thank you

As for LO = local oscillator:
A simple measurement at the LDO output or the DCDC output when power on the voltage should be low.
Once the driver is attached or the EFUSE is loaded then the voltage will be raised to a point that very obvious.
And may I ask what XTAL you are using?

@RadxaYuntian
Copy link
Contributor

In case I wasn't clear the driver DOES NOT work for me. I was not able to connect to any network.

If you still want to try it here is a Debian dkms package in zip (since GitHub doesn't allow deb uploading).

rtw88.zip

I don't have the BOM but I think it is a 24M 12pF crystal. If you are curious here is the schematic for our product:

https://dl.radxa.com/rockpis/docs/hw/ROCK-PI-S_v13_sch_200910.pdf

Search 8723 to see the related page.

@briansune
Copy link
Author

briansune commented Nov 8, 2023

@RadxaYuntian

I need a source to cross compile as my platform is not Debian but ubuntu on different ARM system.
I think you had only update this sections?
radxa-pkg@9d2ffb5

@briansune
Copy link
Author

briansune commented Nov 8, 2023

@RadxaYuntian

As for schematic short review show you are using DCDC setting. The custom board we had here do tired both LDO and DCDC on old RTL8723DS driver. Result both are normal, but DCDC sometime is more easier to be unstable as noise is more subjected to board layout.

@RadxaYuntian
Copy link
Contributor

If you want source code it is available here: https://github.com/radxa-pkg/rtw88/tree/issue_157

@RadxaYuntian
Copy link
Contributor

Looking back I forgot to run with debug_mask and see what was wrong.

@briansune
Copy link
Author

@RadxaYuntian

Let's compare and see if the issue is aligned.

@briansune
Copy link
Author

@RadxaYuntian

I got the current message:

[ 27.285840] rtw_core: loading out-of-tree module taints kernel.
[ 37.657580] rtw_8723ds mmc1:0001:1: rtw88 SDIO probe: vendor=0x024c device=d723 class=ff
[ 37.667085] rtw_8723ds mmc1:0001:1: Firmware version 48.0.0, H2C version 0
[ 38.148561] rtw_8723ds mmc1:0001:1: hw cap: hci=0x06, bw=0x03, ptcl=0x02, ant_num=2, nss=1
[ 38.148576] rtw_8723ds mmc1:0001:1: use rfe_def[17]
[ 38.148586] rtw_8723ds mmc1:0001:1: rfe 17 isn't supported
[ 38.154981] rtw_8723ds mmc1:0001:1: failed to setup chip efuse info
[ 38.159943] rtw_8723ds mmc1:0001:1: failed to setup chip information

@RadxaYuntian
Copy link
Contributor

Your eFuse must have been partially populated, as I changed rfe to come from eFuse first: radxa-pkg@9d2ffb5#diff-bda2ebb54a6c298b057cfa4da3534fd505b263989ec51d3663e3f40d9f3a0ebaL233-R261

You can change line 261 back to efuse->rfe_option = 0;

@briansune
Copy link
Author

briansune commented Nov 8, 2023

@RadxaYuntian

Network can scan and WIFI devices are showing up.
Compared to previous this RTW88 driver it cannot list WIFI devices.
Looks like you had made a different.

And WIFI can ping and connect as well but not sure why nmcli works but not nmtui =S
I don't know much kernel stuff.

image

LOG
[  651.687345] rtw_8723ds mmc1:0001:1: [IQK] path S0 RXIQK Step1!!
[  651.687417] rtw_8723ds mmc1:0001:1: [IQK] 0x67 @S0 RXIQK1 = 0xac
[  651.690200] rtw_8723ds mmc1:0001:1: [IQK] RF0x1@ path S0 RXIQK1 = 0xe6d
[  651.690735] rtw_8723ds mmc1:0001:1: [IQK] RF0x2@ path S0 RXIQK1 = 0x66d
[  651.692222] rtw_8723ds mmc1:0001:1: [IQK] GNT_BT @S0 RXIQK1 = 0xc
[  651.692301] rtw_8723ds mmc1:0001:1: [IQK] 0x948 @S0 RXIQK1 = 0x99000280
[  651.696716] rtw_8723ds mmc1:0001:1: [IQK] 0xeac = 0x4002000
[  651.696844] rtw_8723ds mmc1:0001:1: [IQK] 0xe94 = 0x1000000, 0xe9c = 0x30000
[  651.696970] rtw_8723ds mmc1:0001:1: [IQK] 0xe90(before IQK)= 0x6d0, 0xe98(afer IQK) = 0x44
[  651.697365] rtw_8723ds mmc1:0001:1: [IQK] 0xe40 = 0x81007c03 u4tmp = 0x81007c03
[  651.697377] rtw_8723ds mmc1:0001:1: [IQK] path S0 RXIQK STEP2!!
[  651.697445] rtw_8723ds mmc1:0001:1: [IQK] 0x67 @S0 RXIQK2 = 0xac
[  651.700377] rtw_8723ds mmc1:0001:1: [IQK] RF0x1 @S0 RXIQK2 = 0xe6d
[  651.700903] rtw_8723ds mmc1:0001:1: [IQK] RF0x2 @S0 RXIQK2 = 0x66d
[  651.702390] rtw_8723ds mmc1:0001:1: [IQK] GNT_BT @S0 RXIQK1 = 0xc
[  651.702471] rtw_8723ds mmc1:0001:1: [IQK] 0x948 @S0 RXIQK1 = 0x99000280
[  651.706357] rtw_8723ds mmc1:0001:1: [IQK] 0xea4 = 0xfb0000, 0xeac = 0x4072000
[  651.706487] rtw_8723ds mmc1:0001:1: [IQK] 0xea0(before IQK)= 0x3e500c, 0xea8(afer IQK) = 0x81a0
[  651.709733] rtw_8723ds mmc1:0001:1: [IQK] path S0 Rx IQK Success!!
[  651.710965] rtw_8723ds mmc1:0001:1: [IQK] back to BB mode, load original value!
[  651.713405] rtw_8723ds mmc1:0001:1: [IQK] restore 0x67 = 0xac
[  651.713420] rtw_8723ds mmc1:0001:1: [IQK] cmp 0:1 final_candidate is 0
[  651.714033] rtw_8723ds mmc1:0001:1: [IQK] X = 0xfd, TX1_A = 0xe1, oldval_1 0xe4
[  651.714046] rtw_8723ds mmc1:0001:1: [IQK] Y = 0x2, TX1_C = 0x1
[  651.715137] rtw_8723ds mmc1:0001:1: [IQK] final_candidate is 0
[  651.715157] rtw_8723ds mmc1:0001:1: [IQK] Result 0: rege94_s1=fd rege9c_s1=2 regea4_s1=100 regeac_s1=7 rege94_s0=fd rege9c_s0=4 regea4_s0=fa regeac_s0=8 (final candidate)
[  651.715174] rtw_8723ds mmc1:0001:1: [IQK] Result 1: rege94_s1=fd rege9c_s1=2 regea4_s1=100 regeac_s1=7 rege94_s0=fd rege9c_s0=4 regea4_s0=fb regeac_s0=7
[  651.715190] rtw_8723ds mmc1:0001:1: [IQK] Result 2: rege94_s1=0 rege9c_s1=0 regea4_s1=0 regeac_s1=0 rege94_s0=0 rege9c_s0=0 regea4_s0=0 regeac_s0=0
[  651.715205] rtw_8723ds mmc1:0001:1: [IQK] Result 3: rege94_s1=0 rege9c_s1=0 regea4_s1=0 regeac_s1=0 rege94_s0=0 rege9c_s0=0 regea4_s0=0 regeac_s0=0
[  651.715450] rtw_8723ds mmc1:0001:1: [IQK]0xc80 = 0x390100e1 0xc94 = 0x0 0xc14 = 0x40001d00 0xca0 = 0x12000
[  651.715629] rtw_8723ds mmc1:0001:1: [IQK]0xcd0 = 0x1c2 0xcd4 = 0x1c8007 0xcd8 = 0x80fa
[  651.715639] rtw_8723ds mmc1:0001:1: [IQK] finished
[  651.715650] wlan0: send auth to 04:d4:c4:45:9c:98 (try 1/3)
[  651.721490] wlan0: authenticated
[  651.761467] wlan0: associate with 04:d4:c4:45:9c:98 (try 1/3)
[  651.761520] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_connect_notify(): 2G start
[  651.761532] rtw_8723ds mmc1:0001:1: [BTCoex], (Before Ant Setup) Delay by IQK
[  651.761682] rtw_8723ds mmc1:0001:1: [BTCoex],  coex_stat->bt_disabled = 0x1
[  651.761695] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_set_ant_path() - PHASE_2G_RUNTIME
[  651.763266] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_run_coex(): reason = 5
[  651.763281] rtw_8723ds mmc1:0001:1: [BTCoex], wl_noisy_level = 0
[  651.763369] rtw_8723ds mmc1:0001:1: [BTCoex], WiFi is single-port 2G!!
[  651.763382] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_action_wl_not_connected()
[  651.763394] rtw_8723ds mmc1:0001:1: [BTCoex], Coex_Table - 1
[  651.763547] rtw_8723ds mmc1:0001:1: [BTCoex], Skip TDMA because no change TDMA(off, 0)
[  651.768130] wlan0: RX AssocResp from 04:d4:c4:45:9c:98 (capab=0x1011 status=0 aid=4)
[  651.768180] rtw_8723ds mmc1:0001:1: send H2C content 40a30040 000ff015
[  651.768391] rtw_8723ds mmc1:0001:1: send H2C content 00000101 00000000
[  651.768575] rtw_8723ds mmc1:0001:1: sta 04:d4:c4:45:9c:98 joined with macid 0
[  651.771026] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_connect_notify(): 2G finish
[  651.771042] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_run_coex(): reason = 7
[  651.771053] rtw_8723ds mmc1:0001:1: [BTCoex], wl_noisy_level = 1
[  651.772056] rtw_8723ds mmc1:0001:1: [BTCoex], WiFi is single-port 2G!!
[  651.772069] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_action_wl_only()
[  651.772083] rtw_8723ds mmc1:0001:1: [BTCoex], Coex_Table - 2
[  651.772351] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_set_table(): 0x6c0 = 66555555, 0x6c4 = 66555555
[  651.772366] rtw_8723ds mmc1:0001:1: [BTCoex], Skip TDMA because no change TDMA(off, 0)
[  651.773736] rtw_8723ds mmc1:0001:1: RSVD_PROBE_RESP loc: 0
[  651.773750] rtw_8723ds mmc1:0001:1: RSVD_PS_POLL loc: 1
[  651.773760] rtw_8723ds mmc1:0001:1: RSVD_NULL loc: 3
[  651.773769] rtw_8723ds mmc1:0001:1: RSVD_QOS_NULL loc: 2
[  651.773782] rtw_8723ds mmc1:0001:1: send H2C content 03010000 00000002
[  651.773970] rtw_8723ds mmc1:0001:1: send H2C content 0000002c 00000000
[  651.774142] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_media_status_notify(): 2G
[  651.774155] rtw_8723ds mmc1:0001:1: [BTCoex], (Before Ant Setup) Delay by IQK
[  651.774279] rtw_8723ds mmc1:0001:1: [BTCoex],  coex_stat->bt_disabled = 0x1
[  651.774292] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_set_ant_path() - PHASE_2G_RUNTIME
[  651.775870] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_run_coex(): reason = 9
[  651.775884] rtw_8723ds mmc1:0001:1: [BTCoex], wl_noisy_level = 1
[  651.775971] rtw_8723ds mmc1:0001:1: [BTCoex], WiFi is single-port 2G!!
[  651.775983] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_action_wl_only()
[  651.775995] rtw_8723ds mmc1:0001:1: [BTCoex], Coex_Table - 2
[  651.776138] rtw_8723ds mmc1:0001:1: [BTCoex], Skip TDMA because no change TDMA(off, 0)
[  651.776155] rtw_8723ds mmc1:0001:1: send H2C content 00000066 00000000
[  651.776327] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_update_wl_ch_info: para[0:2] = 0x0 0x0 0x0
[  651.776604] wlan0: associated
[  652.000564] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x00, len=7
[  652.102126] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x01, len=7
[  652.920536] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x02, len=7
[  653.601433] rtw_8723ds mmc1:0001:1: [BTCoex], WL connecting stop!!
[  653.601450] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_run_coex(): reason = 14
[  653.601461] rtw_8723ds mmc1:0001:1: [BTCoex], wl_noisy_level = 1
[  653.601550] rtw_8723ds mmc1:0001:1: [BTCoex], WiFi is single-port 2G!!
[  653.601562] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_action_wl_only()
[  653.601574] rtw_8723ds mmc1:0001:1: [BTCoex], Coex_Table - 2
[  653.601714] rtw_8723ds mmc1:0001:1: [BTCoex], Skip TDMA because no change TDMA(off, 0)
[  654.001703] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  654.001726] rtw_8723ds mmc1:0001:1: send H2C content 17000042 00000000
[  654.004099] rtw_8723ds mmc1:0001:1: IGI=0x20, rssi_min=23, cck_fa=459
[  654.004112] rtw_8723ds mmc1:0001:1: cck_fa_avg=0, cck_pd_default=16
[  654.004123] rtw_8723ds mmc1:0001:1: lv: (0) -> (0)
[  654.004136] rtw_8723ds mmc1:0001:1: send H2C content 00000058 0000000d
[  656.001703] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  656.001727] rtw_8723ds mmc1:0001:1: send H2C content 16000042 00000000
[  656.004282] rtw_8723ds mmc1:0001:1: IGI=0x24, rssi_min=22, cck_fa=1238
[  656.004295] rtw_8723ds mmc1:0001:1: cck_fa_avg=213, cck_pd_default=16
[  656.004306] rtw_8723ds mmc1:0001:1: lv: (0) -> (0)
[  656.004319] rtw_8723ds mmc1:0001:1: send H2C content 00000058 0000000d
[  656.004478] rtw_8723ds mmc1:0001:1: send H2C content 40830040 000ff010
[  656.194064] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x03, len=7
[  656.561441] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_run_coex(): reason = 14
[  656.561474] rtw_8723ds mmc1:0001:1: [BTCoex], wl_noisy_level = 1
[  656.561552] rtw_8723ds mmc1:0001:1: [BTCoex], WiFi is single-port 2G!!
[  656.561563] rtw_8723ds mmc1:0001:1: [BTCoex], rtw_coex_action_wl_only()
[  656.561575] rtw_8723ds mmc1:0001:1: [BTCoex], Coex_Table - 2
[  656.561718] rtw_8723ds mmc1:0001:1: [BTCoex], Skip TDMA because no change TDMA(off, 0)
[  658.001725] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  658.001748] rtw_8723ds mmc1:0001:1: send H2C content 17000042 00000000
[  658.004329] rtw_8723ds mmc1:0001:1: IGI=0x25, rssi_min=23, cck_fa=523
[  658.004342] rtw_8723ds mmc1:0001:1: cck_fa_avg=255, cck_pd_default=16
[  658.004353] rtw_8723ds mmc1:0001:1: lv: (0) -> (2)
[  658.004407] rtw_8723ds mmc1:0001:1: is_linked=1, lv=2, n_rx=1, cs_ratio=0x14, pd_th=0xd, cck_fa_avg=255
[  658.004633] rtw_8723ds mmc1:0001:1: send H2C content 00000058 0000000e
[  659.672210] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x04, len=7
[  660.001704] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  660.001727] rtw_8723ds mmc1:0001:1: send H2C content 17000042 00000000
[  660.004111] rtw_8723ds mmc1:0001:1: IGI=0x25, rssi_min=23, cck_fa=357
[  660.004124] rtw_8723ds mmc1:0001:1: cck_fa_avg=230, cck_pd_default=16
[  660.004135] rtw_8723ds mmc1:0001:1: lv: (2) -> (2)
[  660.004148] rtw_8723ds mmc1:0001:1: send H2C content 00000058 0000000f
[  661.718179] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x05, len=7
[  662.001722] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  662.001745] rtw_8723ds mmc1:0001:1: send H2C content 17000042 00000000
[  662.004335] rtw_8723ds mmc1:0001:1: IGI=0x23, rssi_min=23, cck_fa=239
[  662.004348] rtw_8723ds mmc1:0001:1: cck_fa_avg=204, cck_pd_default=16
[  662.004359] rtw_8723ds mmc1:0001:1: lv: (2) -> (0)
[  662.004412] rtw_8723ds mmc1:0001:1: is_linked=1, lv=0, n_rx=1, cs_ratio=0x10, pd_th=0x3, cck_fa_avg=204
[  662.004639] rtw_8723ds mmc1:0001:1: send H2C content 00000058 00000010
[  664.001752] rtw_8723ds mmc1:0001:1: [BTCoex], Hi-Pri Rx/Tx: 0/0, Lo-Pri Rx/Tx: 0/0
[  664.001776] rtw_8723ds mmc1:0001:1: send H2C content 16000042 00000000
[  664.004361] rtw_8723ds mmc1:0001:1: IGI=0x27, rssi_min=22, cck_fa=934
[  664.004374] rtw_8723ds mmc1:0001:1: cck_fa_avg=499, cck_pd_default=16
[  664.004385] rtw_8723ds mmc1:0001:1: lv: (0) -> (2)
[  664.004439] rtw_8723ds mmc1:0001:1: is_linked=1, lv=2, n_rx=1, cs_ratio=0x14, pd_th=0xd, cck_fa_avg=499
[  664.004666] rtw_8723ds mmc1:0001:1: send H2C content 00000058 00000010
[  664.004827] rtw_8723ds mmc1:0001:1: send H2C content 40830040 000ff010
[  664.173301] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x06, len=7
[  664.889400] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x07, len=7
[  665.810090] rtw_8723ds mmc1:0001:1: recv C2H, id=0x0c, seq=0x08, len=7

@briansune
Copy link
Author

@RadxaYuntian

But I don't understand what is the major reason to use RTW88 rather than RTL8723DS driver?

@lwfinger
What are the different compare between new RTW88-based RTL8723DS and old RTL8723DS driver?

@briansune
Copy link
Author

@RadxaYuntian

And there is a catch that looks like it is not too stable compared to old RTL8723DS:

image

@briansune
Copy link
Author

@RadxaYuntian

1)The same issue happen on two board currently I received from SMT. If RTL8723DS vendor driver fix a blank EFUSE IC. The MAC will randomly change every boot. So nmcli or nmtui will got to modify the connection config file to a no specific MAC.

  1. @lwfinger according to some research and report from REALTEK chip. The EFUSE is commonly got flushed by parasitic voltage stored in bypass capacitors. And this is why there are also reuse chip in the market is got flushed to blank EFUSE. So a self-recover driver is really a must.

@RadxaYuntian
Copy link
Contributor

I think it was a lot more elaborate that was required.

Yeah I was not intended to submit that, which is why it was marked as HACK.

If RTL8723DS vendor driver fix a blank EFUSE IC. The MAC will randomly change every boot.

The random MAC is generated here.

I also tried to check if there is a way for Linux to notify upper layer about missing MAC address. So far I have found nothing (except if we want a random MAC we could use eth_hw_addr_random).

We also have some devices with RTL8211 GbE controller without MAC programmed, and they get consistent MAC address from U-Boot. I'm not sure if this is something that can be done from Linux only that doesn't involve platform specific unique ID.

@briansune
Copy link
Author

@RadxaYuntian

Just share RTL8211 experience on my side. This chip is very old and too many examples and even too many boards had been used in Asia side. So this chip don't even need to concern about not working from first place (Ethernet is more easier and stable when come to driver, what do you expected on GMII or RGMII protocol low speed and not complex).

As I had mentioned EEPROM could be corrupted when the voltage level is remain at some level (remain capacitor charge) and once that is hold during reboot the problem could ends up very very wrong. There are so many story myself also experienced on some client product and claiming stuck or fail working after while. (Not REALTEK product and mostly memory oriented and hardware design itself can't even prevented from first place as vendor or IC design also can't define when it will be the case).

I will try to fix the MAC and see the different, and thank you for locating the line I need to modify really helps out. =]

@briansune
Copy link
Author

briansune commented Nov 16, 2023

@lwfinger
@RadxaYuntian

I would like to know why the vendor driver try to read /data/wifimac.txt and even adding such file won't able to make it read the MAC.

I do see it uses func - isFileReadable @osdep_service.c

From rtw_read_macaddr_from_file @hal_com.c

And begin call hal_config_macaddr @sdio_halinit.c

And other thing I tried and should make the old one or the new RTW88 better:
As MAC is random or fix in here.
So it is better to make it more controllable via MAKE or Kconfig.

I adjusted as follow:

err_chk:

#ifndef CONFIG_RTW_MAC_B4
#define CONFIG_RTW_MAC_B4 0x00
#endif

#ifndef CONFIG_RTW_MAC_B5
#define CONFIG_RTW_MAC_B5 0x00
#endif

	if (rtw_check_invalid_mac_address(mac, _TRUE) == _TRUE) {
#ifdef CONFIG_RTW_RANDOM_MAC
		RTW_ERR("invalid mac addr:"MAC_FMT", assign random MAC\n", MAC_ARG(mac));
		*((u32 *)(&mac[2])) = rtw_random32();
		mac[0] = 0x00;
		mac[1] = 0xe0;
		mac[2] = 0x4c;
#else
		RTW_ERR("invalid mac addr:"MAC_FMT", assign default one\n", MAC_ARG(mac));
		mac[0] = 0x00;
		mac[1] = 0xe0;
		mac[2] = 0x4c;
		mac[3] = 0x87;
		mac[4] = CONFIG_RTW_MAC_B4;
		mac[5] = CONFIG_RTW_MAC_B5;
#endif
	}

	_rtw_memcpy(out, mac, ETH_ALEN);
	RTW_INFO("%s mac addr:"MAC_FMT"\n", __func__, MAC_ARG(out));

And the Make file:

EXTRA_CFLAGS += -DCONFIG_RTW_RANDOM_MAC
or
EXTRA_CFLAGS += -DCONFIG_RTW_MAC_B4=0x12 -DCONFIG_RTW_MAC_B5=0x34

@lwfinger
Copy link
Owner

I have no idea what the vendor driver is trying to get by reading file wifimac.txt. From the name I would guess a MAC address. A better way would be to provide a module parameter where you could specify the MAC as a peermanent "options" file.

@briansune
Copy link
Author

@lwfinger
@RadxaYuntian

I am afraid even getting a real certificated WIFI-module and transfer to the custom board also preform poorly on the WIFI.

See Module:
image
image

See Transfer:
image

See ping test:
image

See the MAC load:
image

So RTW88 SDIO WIFI do have inherent issue that need to fix.

@briansune
Copy link
Author

@lwfinger
@RadxaYuntian

In case, I test the same transferred module IC board with Vendor driver. Very stable and well performed ping test.
image

But I am confused why RTW88 MAC is 4a:6d:a2:41:e1:b5 and RTL8723DS MAC is 68:39:43:9d:10:ef. RTL8723DS driver even reboot serval times show no change on MAC address (so it is a must using EFUSE settings). Do the RTW88 override the MAC address or there is a setting to use EFUSE or custom?

THANK YOU all support.

@lwfinger
Copy link
Owner

There may be a bug, but RTW88 should use the MAC address in the EFUSE. At the moment, it does not work unless the R=EFUSE has a MAC encoded. I will check that out.

Please provide an EFUSE dump for the current card.

@briansune
Copy link
Author

@lwfinger

What do you need? The EFUSE dump using the old vendor driver?

@lwfinger
Copy link
Owner

Yes.

@briansune
Copy link
Author

@lwfinger

Here you go.
module_IC_DUMP.txt

@lwfinger
Copy link
Owner

Thanks. That dump shows the MAC address that the vendor driver shows starting at offset 0x11A. I have not yet discovered how RTW88 gets its address.

@RadxaYuntian
Copy link
Contributor

But I am confused why RTW88 MAC is 4a:6d:a2:41:e1:b5 and RTL8723DS MAC is 68:39:43:9d:10:ef.

That is because I have to provide a dummy MAC for my own chip, which contains invalid MAC address(all 0xFF): https://github.com/radxa-pkg/rtw88/blob/issue_157/rtw8723d.c#L276

@briansune
Copy link
Author

@RadxaYuntian

No you are not in the same page what this question it is referring.
Read back to previous posts, I had brought a WIFI module and transfer the RTL8723DS chip to the custom board and the CHIP is preloaded with certificated RTL8723DS eFUSE.

Just read the previous post starting from #157 (comment).

The test are not using any of your driver nor a modified driver from RTW88 or RTL8723DS vendor driver.

The goal is to verify the default RTW88 driver is stable or not under a certificated module aka RTL8723 eFUSE with confirmed settings.

@RadxaYuntian
Copy link
Contributor

Well the MAC you reported is exactly the one I defined in the code, so you must using my modified version.

@briansune
Copy link
Author

@RadxaYuntian

Do the RTW88 driver from Iwfinger used your new RTW88 code?

@RadxaYuntian
Copy link
Contributor

No, but you probably didn't install it correctly. Try removing it first then reinstall from this repo.

@briansune
Copy link
Author

@RadxaYuntian

Okay there might be a mistake on my side I rerun the test again to make sure. Thank you for pointing out such MAC detail.

@briansune
Copy link
Author

@RadxaYuntian

Yes, you are right the driver is using your modified one.
A very fast update on the SD card show the follow result.
And a fun fact is the RTW88 original one even perform worst than the modified RTW88. (Oh GOD =[)

See image.
image

@briansune
Copy link
Author

@lwfinger
@RadxaYuntian

So what are the solves here. As we all can see the result of a certificated RTL8723DS module also result in poor result.

@RadxaYuntian
Copy link
Contributor

The 8723D module maintainer will need to take a look at your issue.

@briansune
Copy link
Author

@RadxaYuntian

As for your side, do RTW88 driver + RTL8723DS chip shows no performance issue?

@lwfinger
Copy link
Owner

@briansune - After you wasted my time by reporting the wrong MAC results, I have moved this thread down in my priority list.

The reason for poor performance is that rtw88 only copies the MAC from EFUSE and ignores the calibration data, thus the performance problem. If one of you will dig into the vendor driver and tell me what data needs to be copied, then I can prepare a patch. Otherwise, I will ignore this thread.

@briansune
Copy link
Author

briansune commented Nov 21, 2023

@lwfinger

What do you mean wasted your time?

The reason for poor performance is that rtw88 only copies the MAC from EFUSE and ignores the calibration data, thus the performance problem.

Did you see even with MAC address loading via the EFUSE even perform poor than a self combined EFUSE.
Either it is loading from a real certificated RTL8723DS EFUSE or a custom defined one the performance issue is the same. This is nothing to do with EFUSE but the driver.

As I already tried on the hardware side aka my time and money both are being wasted.
This is very clear that:
I had provided:

  1. EMPTY EFUSE chip on @lwfinger provided RTW88 aka claimed maintained driver shows a unsuccessful WiFi connection. No MAC address is unable to loaded from EFUSE and custom EFUSE loading also fail to start the WiFi.
    @RadxaYuntian also agree the same result.

  2. Non empty EFUSE chip but not certificated source on @lwfinger provided RTW88 aka claimed maintained driver shows a successful WiFi connection but perform poorly. MAC address is loaded from EFUSE.

  3. Non empty EFUSE chip and certificated source on @lwfinger provided RTW88 aka claimed maintained driver shows a successful WiFi connection but perform poorly.

@lwfinger There are no proofs from this claim:

The reason for poor performance is that rtw88 only copies the MAC from EFUSE and ignores the calibration data, thus the performance problem.

But only repeatable result of RTW88 driver cannot stably run WiFi:

Either certificated EFUSE or not.

Hope this is very clear.

@briansune
Copy link
Author

briansune commented Nov 21, 2023

@RadxaYuntian

Well if you have no issue on RTW88 as @lwfinger have claimed it is better for me to close the issue.

First I have no intension to use RTW88 as RTL8723DS already working properly and stably.
Second the only reason why I kept helping out is because @RadxaYuntian tried to work out the issue.
Third I also provided additional cost on hardware to demonstrate a hardware test which had provide more than return.

If the original driver owner is not willing to fix it, I am afraid the driver RTW88 will never work normally on RTL8723DS SDIO chip.

I had made my point.

@lwfinger
Copy link
Owner

@briansune - You posted that the device with a valid EFUSE was giving a different MAC with rtw88 than with the vendor driver. I had wasted an hour trying to see why that was before @RadxaYuntian asked why you were getting the same MAC as he had dummied into his source.

@briansune
Copy link
Author

briansune commented Nov 21, 2023

@lwfinger

What are you suggesting? Only EFUSE and MAC is the concern here?
The concern here is not about MAC or EFUSE is the inherent RTW88 work normally on RTL8723DS devices.

@briansune - You posted that the device with a valid EFUSE was giving a different MAC with rtw88 than with the vendor driver. I had wasted an hour trying to see why that was before @RadxaYuntian asked why you were getting the same MAC as he had dummied into his source.

I am no god and neither a software based engineer. so with two parties driver @lwfinger you and @RadxaYuntian. Risk of mixing up is high. an hour of your vs two parities of works:
coding @RadxaYuntian
ordering shipping + compiling + hardware transferring works @briansune

If the driver inherently working properly would all these actions involved from beginning?
We are here to try fix and test the RTW88 issue not to here argue wasted time from who or whom.

Meanwhile, confusedness are strong why you need an hour from first place to see the EFUSE loading in the driver code?
Are not supposed the driver is owned and hosted by you?
Do this driver copied from others or you are not involved in this driver coding?
If so why not simply invoke the code creators here to discuss the issue from the first place?

ColorfulRhino added a commit to ColorfulRhino/build that referenced this issue Jun 9, 2024
- RockPi-S needs rtl8723DS 3rd party driver, so keep it for this board (see lwfinger/rtw88#157 (comment))
- Asus Tinkerboard Rev.2 also has a 8723DS chipset, keep rtl8723DS driver for this board as well to be safe
- BananaPi M4 Zero needs 3rd party driver for RTL8821CU to work properly, suspected cause is the immaturity of the H618 (Link: armbian#6703 (comment))
- Use new drivers from 6.10 onwards instead of 6.11
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

4 participants