NXP / mwifiex-firmware

Other
6 stars 5 forks source link

mwifiex 1.0 (16.68.10.p159) - PCIEUSB-8997 firmware is buggy #1

Open erdoukki opened 3 years ago

erdoukki commented 3 years ago

MVEBU - EspressoBin ULTRA wifi - BUGS with OpenWrt 21.02-RC https://github.com/NXP/mwifiex-firmware/commit/312ca028298317d2babb54080c056408cdb9448b

PCIEUSB-8997: WLAN (PCIE) firmware version: W16.68.10.p159 Bluetooth (USB) firmware version: W16.26.10.p159 The combo image can be downloaded through WLAN only.

Can anyone help with this bug ? https://github.com/kaloz/mwlwifi/issues/397 https://forum.openwrt.org/t/openwrt-21-02-0-third-release-candidate/99363/32

[    8.880656] mwifiex_pcie 0000:01:00.0: info: FW download over, size 638992 bytes
[    9.723892] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[    9.805987] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.10.p159) 
[    9.814683] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.10.p159) 

EDIT: Hardware used for testing: EspressoBin-ULTRA from GlobalScaleTechnologies. Official Product: https://globalscaletechnologies.com/product/espressobin-ultra/ CNX review: https://www.cnx-software.com/2019/12/30/espressobin-ultra-gateway-features-5-gigabit-ethernet-ports-wifi-5-supports-4g-lte-cellular-connectivity/ Block Diagram: http://espressobin.net/wp-content/uploads/2020/05/ESPRESSOBin-Ultra-V1_-Block-diagram_.pdf

OS info (from OpenWrt 21.02.x):

root@ultra:~# uname -ar
Linux ultra 5.4.124 #0 SMP Sun Jun 13 22:02:19 2021 aarch64 GNU/Linux
root@ultra:~# lsusb
Bus 001 Device 003: ID 1286:204e Marvell Bluetooth and Wireless LAN Composite Device
root@ultra:~# dmesg | grep pcie
[    8.838866] mwifiex_pcie: PCI memory map Virt0: 00000000f018cccc PCI memory map Virt2: 00000000726eced0
[   10.169604] mwifiex_pcie 0000:01:00.0: info: FW download over, size 631012 bytes
[   11.034644] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   11.106306] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145) 
[   11.114812] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p145) 

EDIT: A summary of my tests here: https://github.com/NXP/mwifiex-firmware/issues/1#issuecomment-927145355

Tests (quick tests) made only with ONE AP and TWO CLIENTS on the AP...

Config used : cat /etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option path 'soc/d0070000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
    option htmode 'HT20'
    option hwmode '11g'
    option channel 'auto'
    option log_level '1'
    option cell_density '0'
    option country 'FR'
    option legacy_rates '1'

config wifi-iface 'default_radio0'
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option ssid 'ACCESSPOINT'
    option key 'PASSWORD'
    option encryption 'psk2'
    option skip_inactivity_poll '1'
erdoukki commented 3 years ago
[   11.278496] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1                                                                                                  
[   11.306264] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1                                                                                                  
[   17.913709] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb1 error, result=0x1                                                                                                  
[   17.920969] mwifiex_pcie 0000:01:00.0: Failed to start the BSS                                                                                                               
[   17.927025] mwifiex_pcie 0000:01:00.0: Failed to start AP                                                                                                                    
[   23.917702] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb1 error, result=0x1                                                                                                  
[   23.925641] mwifiex_pcie 0000:01:00.0: Failed to start the BSS                                                                                                               
[   23.931672] mwifiex_pcie 0000:01:00.0: Failed to start AP                                                                                                                    
[   29.942278] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb1 error, result=0x1                                                                                                  
[   29.949971] mwifiex_pcie 0000:01:00.0: Failed to start the BSS                                                                                                               
[   29.956065] mwifiex_pcie 0000:01:00.0: Failed to start AP                
erdoukki commented 3 years ago

https://forum.openwrt.org/t/mwlwifi-and-kernel-5-10/90115/18?u=erdoukki

erdoukki commented 3 years ago

root@ULTRA-5G:/# uname -ar

Linux ULTRA-5G 5.4.124 #0 SMP Sun Jun 13 22:02:19 2021 aarch64 GNU/Linux

dmesg / logread give :

Wed Aug  4 14:37:02 2021 kern.info kernel: [ 1440.569280] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
root@ULTRA-5G:~# iw dev
phy#0
    Interface wlan0
        ifindex 20
        wdev 0x1
        addr f0:ad:4e:10:0e:c3
        type AP
        txpower 0.00 dBm
[ 2395.300894] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[ 2453.187918] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[ 2489.210316] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
erdoukki commented 3 years ago

after a reboot, it may works...

erdoukki commented 3 years ago

It looks like only one client get access successfully...

erdoukki commented 3 years ago

I add two tweaks in my /etc/rc.local :

# WIFI FIXME
uci set wireless.radio0.legacy_rates='1'
uci commit
wifi

# WIFI FIXME
iw wlan0 set power_save off

But I still get problems... How can I help to analyse, report and fixes this !?

erdoukki commented 3 years ago

ping @sharvari-nxp

erdoukki commented 3 years ago
# WIFI FIXME
uci set wireless.radio0.legacy_rates='1'
uci commit
wifi

This help to make the Access Point visible and available...

erdoukki commented 3 years ago

I have activated the optional verbose debug log on the wifi device : with option log_level '1'

Fri Aug  6 10:58:45 2021 daemon.notice hostapd: wlan0: interface state ACS->ENABLED
Fri Aug  6 10:58:45 2021 daemon.notice hostapd: wlan0: AP-ENABLED
Fri Aug  6 10:58:51 2021 kern.info kernel: [56066.999853] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb1 error, result=0x1
Fri Aug  6 10:58:51 2021 kern.info kernel: [56067.007152] mwifiex_pcie 0000:01:00.0: Failed to start the BSS
Fri Aug  6 10:58:51 2021 kern.info kernel: [56067.013195] mwifiex_pcie 0000:01:00.0: Failed to start AP
Fri Aug  6 10:58:57 2021 kern.info kernel: [56073.028509] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb1 error, result=0x1
Fri Aug  6 10:58:57 2021 kern.info kernel: [56073.037282] mwifiex_pcie 0000:01:00.0: Failed to start the BSS
Fri Aug  6 10:58:57 2021 kern.info kernel: [56073.043959] mwifiex_pcie 0000:01:00.0: Failed to start AP

with forcing legacy rates I get it up again :

Fri Aug  6 11:00:24 2021 daemon.notice netifd: Network device 'wlan0' link is up
Fri Aug  6 11:00:24 2021 daemon.notice hostapd: wlan0: interface state ACS->ENABLED
Fri Aug  6 11:00:24 2021 daemon.notice hostapd: wlan0: AP-ENABLED
erdoukki commented 3 years ago

Clients may still have issues, like Apples clients (iOS iPAD and iPhone) which get no access to the AP... With WPA or WPA2 I get errors and without encryption I get no IP...

erdoukki commented 3 years ago

I have add a /etc/modules.d/mwifiex file with the following content :

mwifiex reg_alpha2=FR
root@ULTRA-5G:~# dmesg |grep mwifiex_pcie
[    8.709601] mwifiex_pcie: PCI memory map Virt0: 00000000a3db35c7 PCI memory map Virt2: 000000004005f488
[    9.892557] mwifiex_pcie 0000:01:00.0: info: FW download over, size 638992 bytes
[   10.733601] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.791178] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.10.p159) 
[   10.799895] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.10.p159) 
[   16.811868] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   29.661153] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   29.704430] mwifiex_pcie 0000:01:00.0: cannot change wiphy params when bss started
[   30.128058] mwifiex_pcie 0000:01:00.0: cannot register network device
erdoukki commented 3 years ago

I have add a /etc/modules.d/mwifiex file with the following content :

removed... same !

root@ULTRA-5G:~# ethtool -i wlan0
driver: mwifiex_pcie
version: 
firmware-version: 
expansion-rom-version: 
bus-info: 0000:01:00.0
supports-statistics: no
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
erdoukki commented 3 years ago

I test it now also by removing wpad and replacing it by hostapd-openssl

erdoukki commented 3 years ago

I test it now also by removing wpad and replacing it by hostapd-openssl

with forcing legacy rates I get it up again :

# WIFI FIXME
uci set wireless.radio0.legacy_rates='1'
uci commit
wifi

# WIFI FIXME
iw wlan0 set power_save off

added in /etc/rc.local

now I have 4 clients on it... BUT only without encryption... If I enable WPA2 I get now only one client again, the others get faulty with dmesg error logged :

[   63.388904] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[   63.396413] mwifiex_pcie 0000:01:00.0: crypto keys added
[   64.764481] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[   64.771723] mwifiex_pcie 0000:01:00.0: crypto keys added
[   66.169967] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[   66.177264] mwifiex_pcie 0000:01:00.0: crypto keys added
[   70.810310] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[   70.817755] mwifiex_pcie 0000:01:00.0: crypto keys added
[   75.478474] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[   75.485768] mwifiex_pcie 0000:01:00.0: crypto keys added
erdoukki commented 3 years ago

This commit has not the problem : https://github.com/NXP/mwifiex-firmware/blob/2a0a062e79b5fe9007e57c0fcd285e683e22373e/mrvl/pcieusb8997_combo_v4.bin

wget https://github.com/NXP/mwifiex-firmware/blob/2a0a062e79b5fe9007e57c0fcd285e683e22373e/mrvl/pcieusb8997_combo_v4.bin?raw=true -O /lib/firmware/mrvl/pcieusb8997_combo_v4.bin 
reboot

still added wireless.radio0.legacy_rates='1'

root@ULTRA-5G:~# dmesg | grep mwifiex
[    8.642706] mwifiex_pcie: PCI memory map Virt0: 000000009f690fa7 PCI memory map Virt2: 000000005f0cc217
[    9.816137] mwifiex_pcie 0000:01:00.0: info: FW download over, size 634228 bytes
[   10.662822] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.733597] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195) 
[   10.742080] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p195) 
[   17.831804] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   17.910362] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   30.684304] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   30.749067] mwifiex_pcie 0000:01:00.0: cannot change wiphy params when bss started
[   30.804154] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   31.413758] mwifiex_pcie 0000:01:00.0: cannot register network device

No more crypto keys added error and multi clients on the AP are OK !

erdoukki commented 3 years ago
root@ULTRA-5G:~# iwinfo wlan1 info
wlan1     ESSID: "TRIBU"
          Access Point: F0:AD:4E:10:0E:C3
          Mode: Master  Channel: 3 (2.422 GHz)
          Center Channel 1: 3 2: unknown
          Tx-Power: 15 dBm  Link Quality: 47/70
          Signal: -63 dBm  Noise: -92 dBm
          Bit Rate: 13.7 MBit/s
          Encryption: WPA2 PSK (CCMP)
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 1B4B:2B42 0000:0000 [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy1
erdoukki commented 3 years ago
[75068.549574] mwifiex_pcie 0000:01:00.0: mwifiex_cmd_timeout_func: Timeout cmd id = 0xb0, act = 0x1
[75068.558855] mwifiex_pcie 0000:01:00.0: num_data_h2c_failure = 0
[75068.565095] mwifiex_pcie 0000:01:00.0: num_cmd_h2c_failure = 0
[75068.571156] mwifiex_pcie 0000:01:00.0: is_cmd_timedout = 1
[75068.576825] mwifiex_pcie 0000:01:00.0: num_tx_timeout = 0
[75068.582421] mwifiex_pcie 0000:01:00.0: last_cmd_index = 2
[75068.588000] mwifiex_pcie 0000:01:00.0: last_cmd_id: 5e 00 28 00 b0 00 b0 00 28 00
[75068.595732] mwifiex_pcie 0000:01:00.0: last_cmd_act: 01 00 93 00 01 00 01 00 93 00
[75068.603549] mwifiex_pcie 0000:01:00.0: last_cmd_resp_index = 0
[75068.609573] mwifiex_pcie 0000:01:00.0: last_cmd_resp_id: 28 80 28 80 b0 80 28 80 5e 80
[75068.617739] mwifiex_pcie 0000:01:00.0: last_event_index = 2
[75068.623495] mwifiex_pcie 0000:01:00.0: last_event: 58 00 58 00 2e 00 58 00 58 00
[75068.631131] mwifiex_pcie 0000:01:00.0: data_sent=0 cmd_sent=1
[75068.637058] mwifiex_pcie 0000:01:00.0: ps_mode=0 ps_state=0
[75068.642875] mwifiex_pcie 0000:01:00.0: mwifiex_cfg80211_change_beacon: setting mgmt ies failed
[75068.644294] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump start===
[75068.658893] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195) 
[75068.667442] mwifiex_pcie 0000:01:00.0: PCIE register dump start
[75068.673664] mwifiex_pcie 0000:01:00.0: pcie scratch register:
[75068.679650] mwifiex_pcie 0000:01:00.0: reg:0xcf0, value=0xfedcba00
[75068.679650] reg:0xcf8, value=0x2cf004f
[75068.679650] reg:0xcfc, value=0x1444400
[75068.679650] 
[75068.695403] mwifiex_pcie 0000:01:00.0: PCIE register dump end
[75068.701570] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump end===
[75068.708542] mwifiex_pcie 0000:01:00.0: == mwifiex firmware dump start ==
[75070.231652] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state

...<REPEATED MESSAGE !!!>

[75076.140553] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.147088] device wlan1 left promiscuous mode
[75076.151948] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.158425] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.164956] br-lan: port 5(wlan1) entered disabled state
[75076.214180] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.244726] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.251406] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.257878] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.264426] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.270906] mwifiex_pcie 0000:01:00.0: Failed to delete mgmt IEs!
[75076.277192] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.283673] mwifiex_pcie 0000:01:00.0: Failed to stop the BSS
[75076.296785] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.313438] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.465364] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.635037] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.691620] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.783187] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.838125] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.902265] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.935103] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75076.984124] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75077.681523] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75077.703697] mwifiex_pcie 0000:01:00.0: cannot change wiphy params when bss started
[75077.718672] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75077.754913] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75077.951815] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75077.958295] mwifiex_pcie 0000:01:00.0: set mac address failed: ret=-1
[75077.965030] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.260379] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.412613] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.466307] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.585980] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.649712] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.722286] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.752879] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75081.793620] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75112.171061] mwifiex_pcie 0000:01:00.0: == mwifiex firmware dump end ==
[75112.180811] mwifiex_pcie 0000:01:00.0: == mwifiex dump information to /sys/class/devcoredump start
[75112.190429] mwifiex_pcie 0000:01:00.0: == mwifiex dump information to /sys/class/devcoredump end
[75112.199685] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[75112.206740] mwifiex_pcie 0000:01:00.0: info: shutdown mwifiex...
[75112.499259] mwifiex_pcie 0000:01:00.0: info: dnld wifi firmware from 177740 bytes
[75113.892508] mwifiex_pcie 0000:01:00.0: info: FW download over, size 634228 bytes
[75114.618970] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[75114.669483] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195) 
[75114.677955] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p195) 
erdoukki commented 3 years ago
[  434.412893] mwifiex_pcie 0000:01:00.0: mwifiex_cmd_timeout_func: Timeout cmd id = 0x28, act = 0x93                                                                                    
[  434.422232] mwifiex_pcie 0000:01:00.0: num_data_h2c_failure = 0                                                                                                                       
[  434.428488] mwifiex_pcie 0000:01:00.0: num_cmd_h2c_failure = 0                                                                                                                        
[  434.434624] mwifiex_pcie 0000:01:00.0: is_cmd_timedout = 1                                                                                                                            
[  434.440335] mwifiex_pcie 0000:01:00.0: num_tx_timeout = 0                                                                                                                             
[  434.445944] mwifiex_pcie 0000:01:00.0: last_cmd_index = 1                                                                                                                             
[  434.451524] mwifiex_pcie 0000:01:00.0: last_cmd_id: 28 00 28 00 28 00 b0 00 5e 00                                                                                                     
[  434.459267] mwifiex_pcie 0000:01:00.0: last_cmd_act: 93 00 93 00 93 00 01 00 01 00                                                                                                    
[  434.467100] mwifiex_pcie 0000:01:00.0: last_cmd_resp_index = 0                                                                                                                        
[  434.473138] mwifiex_pcie 0000:01:00.0: last_cmd_resp_id: 28 80 b1 80 28 80 b0 80 5e 80                                                                                                
[  434.481315] mwifiex_pcie 0000:01:00.0: last_event_index = 2                                                                                                                           
[  434.487090] mwifiex_pcie 0000:01:00.0: last_event: 2e 00 2c 00 2c 00 58 00 58 00                                                                                                      
[  434.494740] mwifiex_pcie 0000:01:00.0: data_sent=0 cmd_sent=1                                                                                                                         
[  434.500667] mwifiex_pcie 0000:01:00.0: ps_mode=0 ps_state=0                                                                                                                           
[  434.508398] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump start===                                                                                                            
[  434.515599] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195)                                                                                              
[  434.524095] mwifiex_pcie 0000:01:00.0: PCIE register dump start                                                                                                                       
[  434.530202] mwifiex_pcie 0000:01:00.0: pcie scratch register:                                                                                                                         
[  434.536161] mwifiex_pcie 0000:01:00.0: reg:0xcf0, value=0xfedcba00                                                                                                                    
[  434.536161] reg:0xcf8, value=0x224004f                                                                                                                                                
[  434.536161] reg:0xcfc, value=0x1b6b620                                                                                                                                                
[  434.536161]                                                                                                                                                                           
[  434.551775] mwifiex_pcie 0000:01:00.0: PCIE register dump end                                                                                                                         
[  434.557805] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump end===                                                                                                              
[  434.564728] mwifiex_pcie 0000:01:00.0: == mwifiex firmware dump start ==                                                                                                              
[  440.812993] mwifiex_pcie 0000:01:00.0: cmd_wait_q terminated: -110                                                                                                                    
[  440.819535] mwifiex_pcie 0000:01:00.0: mwifiex_cfg80211_change_beacon: setting mgmt ies failed                                                                                        
erdoukki commented 3 years ago

Slow and very unstable !

erdoukki commented 3 years ago

https://forum.openwrt.org/t/mwifiex-bugs-on-espressobin-ultra/103087

erdoukki commented 3 years ago

Slow and very unstable !

[ 434.515599] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195)

Crash at network restart !

Only reboot get the WiFi working, since network restart, and reboot required again !

erdoukki commented 3 years ago

I give a try to : MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145) from https://github.com/NXP/mwifiex-firmware/blob/5446916b53de395245d89400dea566055ec4502c/mrvl/pcieusb8997_combo_v4.bin

[    9.846954] mwifiex_pcie 0000:01:00.0: info: FW download over, size 631012 bytes
[   10.692912] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.755992] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145) 
[   10.764556] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p145) 
erdoukki commented 3 years ago

I give a try to : MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145)

Network could now be restarted... Better results with this version for now ! Will test longer...

erdoukki commented 3 years ago

I give a try to : MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145)

Still buggy :

[ 3048.066459] ------------[ cut here ]------------
[ 3048.071327] NETDEV WATCHDOG: wlan0 (mwifiex_pcie): transmit queue 1 timed out
[ 3048.079046] WARNING: CPU: 0 PID: 0 at 0xffffffc010639750
[ 3048.084559] Modules linked in: xt_connlimit pppoe ppp_async option nf_conncount iptable_nat cdc_mbim xt_state xt_nat xt_helper xt_conntrack xt_connmark xt_connbytes xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT usb_wwan qmi_wwan pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mwifiex_pcie mwifiex ipt_REJECT cfg80211 cdc_ncm xt_time xt_tcpudp xt_tcpmss xt_statistic xt_recent xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY usbserial usbnet slhc rtc_pcf8563 nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_raw iptable_mangle iptable_filter ipt_ECN ip_tables crc_ccitt compat cdc_wdm i2c_pxa xt_set ip_set_list_set ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set
[ 3048.085365]  nfnetlink nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 zram zsmalloc mii gpio_button_hotplug
[ 3048.191007] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.137 #0
[ 3048.197237] Hardware name: Globalscale Marvell ESPRESSOBin Ultra Board (DT)
[ 3048.204468] pstate: 60400005 (nZCv daif +PAN -UAO)
[ 3048.209446] pc : 0xffffffc010639750
[ 3048.213078] lr : 0xffffffc010639750
[ 3048.216705] sp : ffffffc010003dc0
[ 3048.220155] x29: ffffffc010003dc0 x28: ffffffc0109350c0 
[ 3048.225685] x27: 0000000000000140 x26: 00000000ffffffff 
[ 3048.231214] x25: 0000000000000000 x24: 0000000000000000 
[ 3048.236742] x23: 0000000000000001 x22: ffffff803c89c800 
[ 3048.242270] x21: ffffff803c89cc80 x20: ffffffc010936000 
[ 3048.247798] x19: 0000000000000001 x18: 0000000000000000 
[ 3048.253325] x17: 0000000000000000 x16: 0000000000000000 
[ 3048.258851] x15: 0000000000000000 x14: ffffffc0109a2a12 
[ 3048.264378] x13: 0000000000000000 x12: ffffffc0109a2000 
[ 3048.269908] x11: ffffffc010946000 x10: 0000000000000010 
[ 3048.275434] x9 : 0000000000000000 x8 : 756575712074696d 
[ 3048.280961] x7 : 736e617274203a29 x6 : 0000000000000001 
[ 3048.286487] x5 : 0000000000000000 x4 : 0000000000000000 
[ 3048.292014] x3 : 0000000000000000 x2 : ffffff803fdcebd0 
[ 3048.297539] x1 : ffffff803fdcc578 x0 : 0000000000000041 
[ 3048.303066] Call trace:
[ 3048.305630]  0xffffffc010639750
[ 3048.308904]  0xffffffc01010cb08
[ 3048.312178]  0xffffffc01010cdf8
[ 3048.315451]  0xffffffc0100812d4
[ 3048.318724]  0xffffffc0100a5404
[ 3048.321996]  0xffffffc0100f2634
[ 3048.325268]  0xffffffc0100810ac
[ 3048.328540]  0xffffffc010082df0
[ 3048.331813]  0xffffffc0100864f0
[ 3048.335085]  0xffffffc0100d1ffc
[ 3048.338357]  0xffffffc0100d2180
[ 3048.341628]  0xffffffc01077eec8
[ 3048.344900]  0xffffffc0108c086c
[ 3048.348174]  0xffffffc0108c0d28
[ 3048.351449] ---[ end trace 1168348e711ed524 ]---
[ 3048.356613] mwifiex_pcie 0000:01:00.0: 4295242133 : Tx timeout(#1), bss_type-num = 1-0
[ 3054.546288] mwifiex_pcie 0000:01:00.0: 4295242752 : Tx timeout(#2), bss_type-num = 1-0
[ 3060.306044] mwifiex_pcie 0000:01:00.0: 4295243328 : Tx timeout(#3), bss_type-num = 1-0
[ 3066.065733] mwifiex_pcie 0000:01:00.0: 4295243904 : Tx timeout(#4), bss_type-num = 1-0
[ 3381.097672] mwifiex_pcie 0000:01:00.0: 4295275408 : Tx timeout(#1), bss_type-num = 1-0
[ 3391.097460] mwifiex_pcie 0000:01:00.0: 4295276408 : Tx timeout(#2), bss_type-num = 1-0
[ 3401.097404] mwifiex_pcie 0000:01:00.0: 4295277408 : Tx timeout(#3), bss_type-num = 1-0
[ 3411.097611] mwifiex_pcie 0000:01:00.0: 4295278408 : Tx timeout(#4), bss_type-num = 1-0
[ 3421.097061] mwifiex_pcie 0000:01:00.0: 4295279408 : Tx timeout(#5), bss_type-num = 1-0
[ 3616.054327] mwifiex_pcie 0000:01:00.0: 4295298904 : Tx timeout(#1), bss_type-num = 1-0
[ 3621.094253] mwifiex_pcie 0000:01:00.0: 4295299408 : Tx timeout(#2), bss_type-num = 1-0
[ 3631.094131] mwifiex_pcie 0000:01:00.0: 4295300408 : Tx timeout(#3), bss_type-num = 1-0
[ 3641.094082] mwifiex_pcie 0000:01:00.0: 4295301408 : Tx timeout(#4), bss_type-num = 1-0
[ 3651.094035] mwifiex_pcie 0000:01:00.0: 4295302408 : Tx timeout(#5), bss_type-num = 1-0
[ 3661.093977] mwifiex_pcie 0000:01:00.0: 4295303408 : Tx timeout(#6), bss_type-num = 1-0
[ 3821.093104] mwifiex_pcie 0000:01:00.0: 4295319408 : Tx timeout(#1), bss_type-num = 1-0
[ 3831.093062] mwifiex_pcie 0000:01:00.0: 4295320408 : Tx timeout(#2), bss_type-num = 1-0
[ 3841.092999] mwifiex_pcie 0000:01:00.0: 4295321408 : Tx timeout(#3), bss_type-num = 1-0
[ 3851.092853] mwifiex_pcie 0000:01:00.0: 4295322408 : Tx timeout(#4), bss_type-num = 1-0
[ 3861.092955] mwifiex_pcie 0000:01:00.0: 4295323408 : Tx timeout(#5), bss_type-num = 1-0
[ 3871.092876] mwifiex_pcie 0000:01:00.0: 4295324408 : Tx timeout(#6), bss_type-num = 1-0
[ 3881.092845] mwifiex_pcie 0000:01:00.0: 4295325408 : Tx timeout(#7), bss_type-num = 1-0
[ 3881.101189] mwifiex_pcie 0000:01:00.0: tx_timeout_cnt exceeds threshold. Triggering card reset!
[ 3881.123091] mwifiex: Have pending ack frames!
[ 3881.127618] mwifiex: Have pending ack frames!
[ 3881.132133] mwifiex: Have pending ack frames!
[ 3881.136674] mwifiex: Have pending ack frames!
[ 3881.141186] mwifiex: Have pending ack frames!
[ 3881.145712] mwifiex: Have pending ack frames!
[ 3881.150212] mwifiex: Have pending ack frames!
[ 3881.154734] mwifiex: Have pending ack frames!
[ 3881.159234] mwifiex: Have pending ack frames!
[ 3881.163741] mwifiex: Have pending ack frames!
[ 3881.168244] mwifiex: Have pending ack frames!
[ 3881.172747] mwifiex: Have pending ack frames!
[ 3881.177245] mwifiex: Have pending ack frames!
[ 3881.181883] mwifiex: Have pending ack frames!
[ 3881.186457] mwifiex: Have pending ack frames!
[ 3881.198336] mwifiex_pcie 0000:01:00.0: info: shutdown mwifiex...
[ 3881.204602] mwifiex: Have pending ack frames!
[ 3881.209098] mwifiex: Have pending ack frames!
[ 3881.213624] mwifiex: Have pending ack frames!
[ 3881.218117] mwifiex: Have pending ack frames!
[ 3881.222609] mwifiex: Have pending ack frames!
[ 3881.227558] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[ 3881.233782] mwifiex_pcie 0000:01:00.0: Failed to delete mgmt IEs!
[ 3881.240068] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[ 3881.246276] mwifiex_pcie 0000:01:00.0: Failed to stop the BSS
[ 3881.253680] br-lan: port 5(wlan0) entered disabled state
[ 3881.265873] device wlan0 left promiscuous mode
[ 3881.270484] br-lan: port 5(wlan0) entered disabled state
[ 3881.314089] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[ 3881.320447] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[ 3881.673173] mwifiex_pcie 0000:01:00.0: info: dnld wifi firmware from 174940 bytes
[ 3883.063810] mwifiex_pcie 0000:01:00.0: info: FW download over, size 631012 bytes
[ 3883.782802] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[ 3883.842146] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145) 
[ 3883.850682] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p145) 
[ 4077.794696] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[ 4077.823906] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[ 4078.073527] br-lan: port 5(wlan1) entered blocking state
[ 4078.079042] br-lan: port 5(wlan1) entered disabled state
[ 4078.084936] device wlan1 entered promiscuous mode
erdoukki commented 3 years ago

https://community.nxp.com/t5/Wireless-Connectivity/PCIEUSB-8997-firmware-problems-on-Linux/m-p/1320988#M11626

erdoukki commented 3 years ago

best results get with the NXP firmware from here : https://github.com/NXP/imx-firmware/tree/master/nxp/FwImage_8997

pali commented 3 years ago

@erdoukki Could you try to use firmware from the linux-firmware repository? https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/

erdoukki commented 3 years ago

@pali

Already done https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl?id=b7c134f0d3491113958276d631b4e69771a6c5be latest at https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/ refer to: WLAN (PCIE) firmware version: W16.68.10.p159

It was already tested and was buggy ! The only and more stable I have tested for now is the nxp Firmware version: W16.68.10.p16

I can do more test if you want…

pali commented 3 years ago

Could you try older binaries from linux-firmware.git repository?

I'm asking because if you find some older stable version in linux-firmware.git history, it can be reverted. I'm not sure how many people test new versions and providing feedback for linux-firmware.git maintainers could really help.

erdoukki commented 3 years ago

Sure, I'll get some more tests on the linux-firmware history ! Will report.

erdoukki commented 3 years ago

I look to make a list of past firmwares from linux-firmare git...

I also verified the one used atually from NXP/imx-firmware and took some notes !

best results get with the NXP firmware from here : https://github.com/NXP/imx-firmware/tree/master/nxp/FwImage_8997

root@ULTRA-5G:~# wget https://github.com/NXP/imx-firmware/raw/master/nxp/FwImage_8997/pcieuart8997_combo_v4.bin -O /lib/firmware/mrvl/pcieusb8997_combo_v4.bin

May be a mistake, but my workaround may not work with Bluetooth !

root@ULTRA-5G:~# dmesg | grep wifi

[    9.629598] mwifiex_pcie: PCI memory map Virt0: 0000000005a3499a PCI memory map Virt2: 000000004d4fe816
[   10.675157] mwifiex_pcie 0000:01:00.0: info: FW download over, size 627620 bytes
[   11.523802] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   11.581313] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.10.p16) 
[   11.589871] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.10.p16) 
[   17.988243] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   18.016874] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   43.048214] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

root@ULTRA-5G:~# cat /etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option path 'soc/d0070000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
    option htmode 'HT20'
    option hwmode '11g'
    option channel 'auto'
    option log_level '1'
    option cell_density '0'
    option country 'FR'
    option legacy_rates '1'
...

I then find an unresolved problems ! I have to rename the file... And may be the USB/Bluetooth, still untested, will bug !?

Open an issue at NXP/imx-firmware repository : https://github.com/NXP/imx-firmware/issues/2

pali commented 3 years ago

There are seven versions of pcieusb8997_combo_v4.bin firmware in linux-firmware repository: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/mrvl/pcieusb8997_combo_v4.bin

Check which version is working and which not. Ideally which version / commit broke it.

erdoukki commented 3 years ago

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/log/mrvl/pcieusb8997_combo_v4.bin

The two last versions were already tested... But get some problems if I looking to my notes !

I will check again all the seven to test which ones works.

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=b7c134f0d3491113958276d631b4e69771a6c5be

2021-07-16  linux-firmware: update NXP 8897/8997 firmware images20210716    Sharvari Harisangam 1   -0/+0
linux-firmware: update NXP 8897/8997 firmware images20210716
SDSD-8897:
WLAN (SDIO) firmware version: W15.68.19.p54
Bluetooth (SDIO) firmware version: 15.26.19.p54
The combo image can be downloaded through either WLAN or
Bluetooth.

PCIEUSB-8997:
WLAN (PCIE) firmware version: W16.68.10.p159
Bluetooth (USB) firmware version: W16.26.10.p159
The combo image can be downloaded through WLAN only.

Signed-off-by: Rakesh Parmar <rakesh.parmar@nxp.com>
Signed-off-by: Sharvari Harisangam <sharvari.harisangam@nxp.com>
Signed-off-by: Josh Boyer <jwboyer@kernel.org>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=bd72387b8e49b1b7268ee60c97a131419284fb39

2019-02-12  linux-firmware: update Marvell PCIe-USB8997 firmware image  Ganapathi Bhat  1   -0/+0
linux-firmware: update Marvell PCIe-USB8997 firmware image
WLAN (PCIe) firmware version: W16.68.1.p195
Bluetooth (USB) firmware version: 16.26.1.p195

In PCIe-USB chipset, WLAN is over PCIe whereas bluetooth is over
USB. The combo image will be downloaded through WLAN only.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=5446916b53de395245d89400dea566055ec4502c

2018-01-16  linux-firmware: update Marvell PCIe-USB8897/8997 firmware image to add WPA2 v...    Xinming Hu  1   -0/+0
linux-firmware: update Marvell PCIe-USB8897/8997 firmware image to add WPA2 vulnerability fix
PCIe/USB-8897:
    WLAN (PCIe) firmware version: V15.68.7.p154
    Bluetooth (USB) firmware version: 15.28.7.p154
    The combo image will be downloaded through WLAN only.
    'V' flag indicate the firmware image fix the WPA2
    vulnerability issue.

PCIe/USB-8997:
    WLAN (PCIe) firmware version: V16.68.1.p145
    Bluetooth (USB) firmware version: 16.26.1.p145
    The combo image will be downloaded through WLAN only.
    'V' flag indicate the firmware image fix the WPA2
    vulnerability issue.

    Signed-off-by: Xinming Hu <huxm@marvell.com>
    Signed-off-by: Cathy Luo <cluo@marvell.com>
    Signed-off-by: James Cao <jcao@marvell.com>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=db3e1855ea46bc1a22b8bbecb400c2909c551cf5

2017-10-31  linux-firmware: update Marvell PCIe-USB8997 firmware image  Ganapathi Bhat  1   -0/+0
linux-firmware: update Marvell PCIe-USB8997 firmware image
Firmware version for this image is 16.68.1.p140

In PCIe-USB chipset, WLAN is over PCIe whereas bluetooth is over
USB.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: James Cao <jcao@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=e0494e95192ac5329989f4d128cf95c417d618cc

2017-08-01  linux-firmware: update Marvell PCIe-USB8997 firmware image  Ganapathi Bhat  1   -0/+0
linux-firmware: update Marvell PCIe-USB8997 firmware image
Firmware version for this image is 16.68.1.p133

In PCIe-USB chipset, WLAN is over PCIe whereas bluetooth is over
USB.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=8f171e29aade68e8a9193e288ba526e6f8fa7575

2017-02-20  linux-firmware: update Marvell PCIe-USB8997 firmware image  Amitkumar Karwar    1   -0/+0
linux-firmware: update Marvell PCIe-USB8997 firmware image
Firmware version for this image is 16.68.1.p97

In PCIe-USB chipset, WLAN is over PCIe whereas bluetooth is over
USB.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>

https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/mrvl/pcieusb8997_combo_v4.bin?id=f6bd0141f7d153adb93284e85413bbb3efc750a7

2016-09-12  linux-firmware: add Marvell PCIe8997 firmware images    Amitkumar Karwar    1   -0/+0
linux-firmware: add Marvell PCIe8997 firmware images
Firmware version for these images is 16.68.1.p70

PCIe-USB and PCIe-UART are two variant of PCIe8997 chipset in which WLAN
is over PCIe whereas bluetooth can be over USB or UART bus.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
erdoukki commented 3 years ago
* W16.68.10.p159

root@ULTRA-5G:~# dmesg | grep wifi

[    8.830319] mwifiex_pcie: PCI memory map Virt0: 000000009ee15f82 PCI memory map Virt2: 000000002d03ecb5
[   10.014029] mwifiex_pcie 0000:01:00.0: info: FW download over, size 638992 bytes
[   10.852904] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.921439] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.10.p159) 
[   10.930105] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.10.p159) 
[   17.203330] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   17.254578] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   42.003874] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

Problem: only 1 client can access wifi AP !

[30621.850480] wlo1: authenticated
[30621.853426] wlo1: associate with f0:ad:4e:10:0e:c3 (try 1/3)
[30621.857296] wlo1: RX AssocResp from f0:ad:4e:10:0e:c3 (capab=0x431 status=0 aid=2)
[30621.859372] wlo1: associated
[30622.866529] wlo1: deauthenticated from f0:ad:4e:10:0e:c3 (Reason: 3=DEAUTH_LEAVING)
[30623.409278] wlo1: authenticate with f0:ad:4e:10:0e:c3

root@ULTRA-5G:~# dmesg

Sat Sep 25 17:17:58 2021 kern.info kernel: [  623.289605] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
Sat Sep 25 17:17:58 2021 kern.info kernel: [  623.296916] mwifiex_pcie 0000:01:00.0: crypto keys added

root@ULTRA-5G:~# dmesg | grep wifi

[    8.936601] mwifiex_pcie: PCI memory map Virt0: 0000000094d3ece2 PCI memory map Virt2: 000000007a972d37
[   10.080626] mwifiex_pcie 0000:01:00.0: info: FW download over, size 638992 bytes
[   10.922970] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.984209] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.10.p159) 
[   10.992807] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.10.p159) 
[   18.969282] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   19.001999] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   44.483426] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[  102.986783] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[  102.994725] mwifiex_pcie 0000:01:00.0: crypto keys added
[  103.950206] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb5 error, result=0x1
[  105.768934] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[  105.776304] mwifiex_pcie 0000:01:00.0: crypto keys added
[  107.214448] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[  107.221783] mwifiex_pcie 0000:01:00.0: crypto keys added
[  108.767586] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[  108.774865] mwifiex_pcie 0000:01:00.0: crypto keys added
[  110.222929] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x5e error, result=0x1
[  110.230283] mwifiex_pcie 0000:01:00.0: crypto keys added
[  111.230652] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xb5 error, result=0x1
erdoukki commented 3 years ago

W16.68.1.p195

root@ULTRA-5G:~# dmesg | grep wifi

[    9.226031] mwifiex_pcie: PCI memory map Virt0: 00000000722055c8 PCI memory map Virt2: 0000000003774465
[   10.441357] mwifiex_pcie 0000:01:00.0: info: FW download over, size 634228 bytes
[   11.282976] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   11.341402] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195) 
[   11.350021] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p195) 
[   19.118151] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   19.156338] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1

Problem: only 1 client can access wifi AP !

root@ULTRA-5G:~# dmesg | grep wifi

[   68.982841] mwifiex_pcie 0000:01:00.0: mwifiex_cmd_timeout_func: Timeout cmd id = 0xb0, act = 0x1
[   68.992070] mwifiex_pcie 0000:01:00.0: num_data_h2c_failure = 0
[   68.998282] mwifiex_pcie 0000:01:00.0: num_cmd_h2c_failure = 0
[   69.004388] mwifiex_pcie 0000:01:00.0: is_cmd_timedout = 1
[   69.010057] mwifiex_pcie 0000:01:00.0: num_tx_timeout = 0
[   69.015692] mwifiex_pcie 0000:01:00.0: last_cmd_index = 3
[   69.021285] mwifiex_pcie 0000:01:00.0: last_cmd_id: 5e 00 28 00 28 00 b0 00 b0 00
[   69.029062] mwifiex_pcie 0000:01:00.0: last_cmd_act: 01 00 93 00 93 00 01 00 01 00
[   69.036925] mwifiex_pcie 0000:01:00.0: last_cmd_resp_index = 2
[   69.042981] mwifiex_pcie 0000:01:00.0: last_cmd_resp_id: 5e 80 28 80 28 80 28 80 b0 80
[   69.051159] mwifiex_pcie 0000:01:00.0: last_event_index = 1
[   69.056980] mwifiex_pcie 0000:01:00.0: last_event: 58 00 2e 00 58 00 58 00 58 00
[   69.064652] mwifiex_pcie 0000:01:00.0: data_sent=0 cmd_sent=1
[   69.070588] mwifiex_pcie 0000:01:00.0: ps_mode=1 ps_state=0
[   69.076681] mwifiex_pcie 0000:01:00.0: mwifiex_cfg80211_change_beacon: setting mgmt ies failed
[   69.077882] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump start===
[   69.092734] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p195) 
[   69.101244] mwifiex_pcie 0000:01:00.0: PCIE register dump start
[   69.107398] mwifiex_pcie 0000:01:00.0: pcie scratch register:
[   69.113379] mwifiex_pcie 0000:01:00.0: reg:0xcf0, value=0xfedcba00
[   69.113379] reg:0xcf8, value=0x22f00f8
[   69.113379] reg:0xcfc, value=0x1c9c900
[   69.113379] 
[   69.129027] mwifiex_pcie 0000:01:00.0: PCIE register dump end
[   69.135091] mwifiex_pcie 0000:01:00.0: ===mwifiex driverinfo dump end===
[   69.142014] mwifiex_pcie 0000:01:00.0: == mwifiex firmware dump start ==
[  111.707705] mwifiex_pcie 0000:01:00.0: == mwifiex firmware dump end ==
[  111.717239] mwifiex_pcie 0000:01:00.0: == mwifiex dump information to /sys/class/devcoredump start
[  111.726869] mwifiex_pcie 0000:01:00.0: == mwifiex dump information to /sys/class/devcoredump end
[  111.736066] mwifiex_pcie 0000:01:00.0: PREP_CMD: FW is in bad state
[  111.743106] mwifiex_pcie 0000:01:00.0: info: shutdown mwifiex...
[  111.749765] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[  111.756146] mwifiex_pcie 0000:01:00.0: Failed to delete mgmt IEs!
[  111.762490] mwifiex_pcie 0000:01:00.0: PREP_CMD: card is removed
[  111.768815] mwifiex_pcie 0000:01:00.0: Failed to stop the BSS
erdoukki commented 3 years ago

V16.68.1.p145 ('V' flag indicate the firmware image fix the WPA2 vulnerability issue.)

root@ULTRA-5G:~# dmesg | grep wifi

[    9.496391] mwifiex_pcie: PCI memory map Virt0: 00000000bd2a9cb2 PCI memory map Virt2: 000000006fcb6bbf
[   10.651346] mwifiex_pcie 0000:01:00.0: info: FW download over, size 631012 bytes
[   11.495627] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   11.553501] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p145) 
[   11.561964] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p145) 
[   19.399508] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   19.432497] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   46.339066] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

two clients : OK looks to work fine !

erdoukki commented 3 years ago

16.68.1.p140

root@ULTRA-5G:~# dmesg | grep wifi

[    8.923516] mwifiex_pcie: PCI memory map Virt0: 0000000096d3b7c6 PCI memory map Virt2: 000000000fcae741
[   10.091709] mwifiex_pcie 0000:01:00.0: info: FW download over, size 622532 bytes
[   10.933277] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.996724] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p140) 
[   11.005299] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p140) 
[   18.975739] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   19.005051] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   44.923101] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

two clients : OK looks to work fine !

erdoukki commented 3 years ago

16.68.1.p133

root@ULTRA-5G:~# dmesg | grep wifi

[    8.986976] mwifiex_pcie: PCI memory map Virt0: 000000004831567e PCI memory map Virt2: 0000000027b0c31e
[   10.154634] mwifiex_pcie 0000:01:00.0: info: FW download over, size 620800 bytes
[   10.993007] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   11.044965] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p133) 
[   11.053476] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p133) 
[   18.708355] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   18.741340] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   44.358715] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

two clients : OK looks to work fine !

erdoukki commented 3 years ago

16.68.1.p97

root@ULTRA-5G:~# dmesg | grep wifi

[    8.807778] mwifiex_pcie: PCI memory map Virt0: 00000000cd449e21 PCI memory map Virt2: 0000000097a3ae41
[    9.974986] mwifiex_pcie 0000:01:00.0: info: FW download over, size 597136 bytes
[   10.702868] mwifiex_pcie 0000:01:00.0: WLAN FW is active
[   10.764722] mwifiex_pcie 0000:01:00.0: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p97) 
[   10.773164] mwifiex_pcie 0000:01:00.0: driver_version = mwifiex 1.0 (16.68.1.p97) 
[   18.761495] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1
[   18.798401] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0xd1 error, result=0x1
[   44.430588] mwifiex_pcie 0000:01:00.0: CMD_RESP: cmd 0x20 error, result=0x1

two clients : OK looks to work fine !

erdoukki commented 3 years ago

16.68.1.p70

KO Not loading firmware

root@ULTRA-5G:~# dmesg | grep wifi

[    8.823912] mwifiex_pcie: PCI memory map Virt0: 0000000065b7d8bd PCI memory map Virt2: 00000000fcc32dbc
[    9.016220] mwifiex_pcie 0000:01:00.0: mwifiex_prog_fw_w_helper: Card failed to ACK download
[    9.025042] mwifiex_pcie 0000:01:00.0: prog_fw failed ret=0xffffffff
[    9.031610] mwifiex_pcie 0000:01:00.0: info: _mwifiex_fw_dpc: unregister device
[    9.040320] mwifiex_pcie 0000:01:00.0: performing cancel_work_sync()...
[    9.047282] mwifiex_pcie 0000:01:00.0: cancel_work_sync() done
erdoukki commented 3 years ago

Tests (quick tests) made only with ONE AP and TWO CLIENTS on the AP...

Config used : cat /etc/config/wireless

config wifi-device 'radio0'
    option type 'mac80211'
    option path 'soc/d0070000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
    option htmode 'HT20'
    option hwmode '11g'
    option channel 'auto'
    option log_level '1'
    option cell_density '0'
    option country 'FR'
    option legacy_rates '1'

config wifi-iface 'default_radio0'
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option ssid 'ACCESSPOINT'
    option key 'PASSWORD'
    option encryption 'psk2'
    option skip_inactivity_poll '1'
erdoukki commented 3 years ago

@pali hope I forget nothing ! ;-)

pali commented 3 years ago

[ 9.016220] mwifiex_pcie 0000:01:00.0: mwifiex_prog_fw_w_helper: Card failed to ACK download

Error message Card failed to ACK download is here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/marvell/mwifiex/pcie.c?h=v5.14#n2386

And is caused by loop retries, up the MAX_POLL_TRIES = 100 tries.

MAX_POLL_TRIES is defined here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/wireless/marvell/mwifiex/fw.h?h=v5.14#n126

You could try to increase MAX_POLL_TRIES if it helps (maybe firmware is slower). E.g. to very big value 1000000.

erdoukki commented 3 years ago

Thanks for the information @pali ... I think this old 16.68.1.p70 firmware from 2016-09-12 may be forget !

erdoukki commented 3 years ago

V16.68.1.p145

I will test more with the V16.68.1.p145 ! latest which allow more than 1 clients...

pali commented 3 years ago

Well, driver should work with any firmware version. Above MAX_POLL_TRIES is used for lot of other actions. And if that retry count is small it could mean that also other commands could timeout / cause issues. So if changing retry count for older firmware version helps it could mean that driver needs more tweaks also for new firmware versions.

erdoukki commented 3 years ago

I get issue in old tests with V16.68.1.p145 : https://github.com/NXP/mwifiex-firmware/issues/1#issuecomment-895921503 Hope the BSOD where from other components !

erdoukki commented 3 years ago

Well, driver should work with any firmware version. Above MAX_POLL_TRIES is used for lot of other actions. And if that retry count is small it could mean that also other commands could timeout / cause issues. So if changing retry count for older firmware version helps it could mean that driver needs more tweaks also for new firmware versions.

Okay, but I have not compile the OpenWrt firmware I actually use on my ULTRA. I use only an official one 21.02.x ! If you want tests with the recommended value, I can do, but later. I have first to make a custom firmware.

pali commented 3 years ago

You can also put this card into any other device (for which you can re-compile kernel easily).

pali commented 3 years ago
  • W16.68.10.p159 = KO
  • W16.68.1.p195 = KO
  • V16.68.1.p145 = OK
  • 16.68.1.p140 = OK
  • 16.68.1.p133 = OK
  • 16.68.1.p97 = OK
  • 16.68.1.p70 = KO

Perfect! So obviously problematic is version W16.68.1.p195.

Version W16.68.1.p195 of pcieusb8997_combo_v4.bin was included into linux-firmware repository by this pull request: https://lore.kernel.org/all/CA+5PVA5yQbjg3vaT7F8120B6ngLn7+sZC0OWt0KoUiQR9hS4FA@mail.gmail.com/

And latest version W16.68.10.p159 of pcieusb8997_combo_v4.bin by this pull request: https://lore.kernel.org/linux-firmware/CA+5PVA5on7+CRtEV7tThPxgucwt3W9i-tEXm4cgH-AmMB-Jrtg@mail.gmail.com/

Please send this test summary to linux-firmware@kernel.org mailing list and to Josh Boyer (merged above pull requests to linux-firmware repository) and explain this issue. It is obviously critical usability error. Also add into copy all people from above two pull request emails, so they would be notified about this issue. Also add linux-wireless@vger.kernel.org to copy so other developers would see this issue (you can browse archive to see that mwifiex is under active discussion). And add also me to the copy :)

Either responsible people will come up with patches (to firmware or to driver) OR firmware files in linux-fimware would be revered.