mt76x2e hardware restart

From: Oleksandr Natalenko
Date: Thu Sep 19 2019 - 12:24:10 EST


Hi.

Recently, I've got the following card:

01:00.0 Network controller: MEDIATEK Corp. Device 7612
Subsystem: MEDIATEK Corp. Device 7612
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at 81200000 (64-bit, non-prefetchable) [size=1M]
Expansion ROM at 81300000 [disabled] [size=64K]
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting
Capabilities: [148] Device Serial Number 00-00-00-00-00-00-00-00
Capabilities: [158] Latency Tolerance Reporting
Capabilities: [160] L1 PM Substates
Kernel driver in use: mt76x2e
Kernel modules: mt76x2e

I try to use it as an access point with the following configuration:

interface=wlp1s0
driver=nl80211
ssid=someap
channel=36
noscan=1
hw_mode=a
ieee80211n=1
require_ht=1
ieee80211ac=1
require_vht=1
vht_oper_chwidth=1
vht_capab=[SHORT-GI-80][RX-STBC-1][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
vht_oper_centr_freq_seg0_idx=42
auth_algs=1
wpa=2
wpa_passphrase=somepswd
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
macaddr_acl=1
accept_mac_file=/etc/hostapd/hostapd.allow
ctrl_interface=/run/hostapd
ctrl_interface_group=0
country_code=CZ
ieee80211d=1
ieee80211h=1
wmm_enabled=1
ht_capab=[GF][HT40+][SHORT-GI-20][SHORT-GI-40][RX-STBC1][DSSS_CCK-40]

The hostapd daemon starts, and the AP broadcasts the beacons:

zÃÅ 19 17:50:04 srv hostapd[13251]: Configuration file: /etc/hostapd/ap_5ghz.conf
zÃÅ 19 17:50:05 srv hostapd[13251]: wlp1s0: interface state UNINITIALIZED->COUNTRY_UPDATE
zÃÅ 19 17:50:05 srv hostapd[13251]: Using interface wlp1s0 with hwaddr xx:xx:xx:xx:xx:xx and ssid "someap"
zÃÅ 19 17:50:05 srv hostapd[13251]: wlp1s0: interface state COUNTRY_UPDATE->ENABLED
zÃÅ 19 17:50:05 srv hostapd[13251]: wlp1s0: AP-ENABLED
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 1)
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 1)
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: AP-STA-CONNECTED xx:xx:xx:xx:xx:xx
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session 07E311195378B570
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session 07E311195378B570
zÃÅ 19 17:50:17 srv hostapd[13251]: wlp1s0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)

The client is able to see it and connect to it, but after a couple of seconds the following happens on the AP:

[ +9,979664] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[ +0,000014] mt76x2e 0000:01:00.0: Build: 1
[ +0,000010] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[ +0,018017] mt76x2e 0000:01:00.0: Firmware running!
[ +0,001101] ieee80211 phy4: Hardware restart was requested

and the AP dies. The client cannot reconnect to it, although hostapd logs show that it tries:

zÃÅ 19 17:51:15 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:51:15 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:51:19 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:51:19 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:52:54 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:52:54 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:52:59 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:52:59 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
zÃÅ 19 17:56:14 srv hostapd[13504]: wlp1s0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)

AP stays completely unusable until I remove and modprobe mt76x2e module again. And then everything begins from scratch, and the AP dies within seconds.

I observe this on a fresh v5.3 kernel. I haven't tried anything older.

The only somewhat relevant thread I was able to found is [1], but it's not clear what's the resolution if any.

Could you please suggest how to deal with this issue?

Thanks.

[1] https://forum.openwrt.org/t/wifi-issues-with-18-06-4-on-mt76/40537

--
Oleksandr Natalenko (post-factum)