2021-11-26 10:32:10

by Martin Fuzzey

[permalink] [raw]
Subject: [REGRESSION] mwifiex: mwifiex_get_chan_type noisy and possibly incorrect after kernel upgrade

Hi,

After upgrading an old system using a SD8787 wifi module from kernel
4.4 to 5.4.143 I started getting error messages in the logs
mwifiex_sdio mmc2:0001:1: CMD_RESP: cmd 0x23f error, result=0x2

The same error occurs on 5.15 too.
With Android userspace this occurs every 3 seconds but can be
reproduced with a Linux userspace too using the wpa_cli "signal_poll"
command
(Android polls that command via wpa_supplicant)

root@hw-test:~# wpa_cli
wpa_cli v2.8-devel
Copyright (c) 2004-2019, Jouni Malinen <[email protected]> and contributors
...
Selected interface 'mlan0'
Interactive mode

> signal_poll
[ 143.963217] mwifiex_sdio mmc2:0001:1: CMD_RESP: cmd 0x23f error, result=0x2
RSSI=-5
LINKSPEED=65
NOISE=-75
FREQUENCY=2437
WIDTH=20 MHz
CENTER_FRQ1=2437
AVG_RSSI=-5

Firmware version is 14.68.35.p66 (latest from linux-firmware git)

The 0x23f command is HostCmd_CMD_STA_CONFIGURE and was added in 4.16 by
28bf8312a983 ("mwifiex: get_channel from firmware")

I don't see anywhere in the code defining the 0x2 result code.

The error occurs during processing of the netlink
NL80211_CMD_GET_INTERFACE command which is part of
wpa_supplicant's nl80211_signal_poll()

Kernel side callstack is
nl80211_get_interface
nl80211_send_iface
mwifiex_cfg80211_get_channel
mwifiex_get_chan_type
mwifiex_get_chan_info
mwifiex_send_cmd(HostCmd_CMD_STA_CONFIGURE,
HostCmd_ACT_GEN_GET)


In addition to the log spam the result is also potentially incorrect
since when the command fails a 20MHz channel width is assumed.
The connection still works correctly however

Regards,

Martin