openwrt / openwrt/mt76

MT7922 fails to start AP on boot

Open
#982 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
888
Forks
436
PR merge metrics
No merged PRs in 30d

Description

When I reboot my OpenWrt router, MT7922 PCI Wireless card did not start.
00:10.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter
Needed to click restart on LuCI UI or ssh in and run wifi.

root@OpenWrt:~# dmesg | grep mt
[    7.830919] mt7921e 0000:00:10.0: ASIC revision: 79220010
[    7.916632] mt7921e 0000:00:10.0: HW/SW Version: 0x8a108a10, Build Time: 20231120183400a
[    7.931254] mt7921e 0000:00:10.0: WM Firmware Version: ____000000, Build Time: 20231120183441

root@OpenWrt:~# iw list
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 4
        max scan IEs length: 482 bytes
        max # sched scan SSIDs: 10
        max # match sets: 16
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports AP-side u-APSD.
        Device supports T-DLS.
        Available Antennas: TX 0x3 RX 0x3
        Configured Antennas: TX 0x3 RX 0x3
        Supported interface modes:
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * P2P-client
                 * P2P-GO
                 * P2P-device

Image

After restarting that's is when Access Point is restarted, presumably by the hostapd daemon. Which wasn't getting triggered after kernel startup?

Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Set new config for phy phy0:
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Set new config for phy phy0: /var/run/hostapd-phy0.conf
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Restart interface for phy phy0
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=2 logger_stdout=127 logger_stdout_level=2 country_code=JP ieee80211d=1 ieee80211h=1 hw_mode=a beacon_int=100 stationary_ap=1 tx_queue_data2_burst=2.0 #num_global_macaddr=1 #macaddr_base= ieee80211n=1 ht_coex=0 ht_capab=[LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935] ieee80211ac=1 vht_oper_chwidth=0 vht_oper_centr_freq_seg0_idx= vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMEE][MU-BEAMFORMEE][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][BF-ANTENNA-4][MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP7] ieee80211ax=1 he_oper_chwidth=0 he_oper_centr_freq_seg0_idx= he_bss_color=128 he_spr_sr_control=3 he_default_pe_duration=4 he_rts_threshold=1023 he_mu_edca_qos_info_param_count=0 he_mu_edca_qos_info_q_ack=0 he_mu_edca_qos_info_queue_request=0 he_mu_edca_qos_info_txop_request=0 he_mu_edca_ac_be_aifsn=8 he_mu_edca_ac_be_aci=0 he_mu_edca_ac_be_ecwmin=9 he_mu_edca_ac_be_ecwmax=10 he_mu_ed
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->ACS
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: ACS-STARTED
Mon Jun  2 15:58:09 2025 kern.info kernel: [ 1147.935095] br-lan: port 2(phy0-ap0) entered blocking state
Mon Jun  2 15:58:09 2025 kern.info kernel: [ 1147.935577] br-lan: port 2(phy0-ap0) entered disabled state
Mon Jun  2 15:58:09 2025 kern.info kernel: [ 1147.935986] mt7921e 0000:00:10.0 phy0-ap0: entered allmulticast mode
Mon Jun  2 15:58:09 2025 kern.info kernel: [ 1147.936459] mt7921e 0000:00:10.0 phy0-ap0: entered promiscuous mode
root@OpenWrt:~# logread | grep hostapd
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Set new config for phy phy0:
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Set new config for phy phy0: /var/run/hostapd-phy0.conf
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Restart interface for phy phy0
Mon Jun  2 15:58:08 2025 daemon.notice hostapd: Configuration file: data: driver=nl80211 logger_syslog=127 logger_syslog_level=2 logger_stdout=127 logger_stdout_level=2 country_code=JP ieee80211d=1 ieee80211h=1 hw_mode=a beacon_int=100 stationary_ap=1 tx_queue_data2_burst=2.0 #num_global_macaddr=1 #macaddr_base= ieee80211n=1 ht_coex=0 ht_capab=[LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][MAX-AMSDU-7935] ieee80211ac=1 vht_oper_chwidth=0 vht_oper_centr_freq_seg0_idx= vht_capab=[RXLDPC][SHORT-GI-80][TX-STBC-2BY1][SU-BEAMFORMEE][MU-BEAMFORMEE][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][RX-STBC-1][BF-ANTENNA-4][MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP7] ieee80211ax=1 he_oper_chwidth=0 he_oper_centr_freq_seg0_idx= he_bss_color=128 he_spr_sr_control=3 he_default_pe_duration=4 he_rts_threshold=1023 he_mu_edca_qos_info_param_count=0 he_mu_edca_qos_info_q_ack=0 he_mu_edca_qos_info_queue_request=0 he_mu_edca_qos_info_txop_request=0 he_mu_edca_ac_be_aifsn=8 he_mu_edca_ac_be_aci=0 he_mu_edca_ac_be_ecwmin=9 he_mu_edca_ac_be_ecwmax=10 he_mu_ed
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: ACS: Automatic channel selection started, this may take a bit
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: interface state COUNTRY_UPDATE->ACS
Mon Jun  2 15:58:09 2025 daemon.notice hostapd: phy0-ap0: ACS-STARTED
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5180 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5200 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5200 is missing noise floor
Mon Jun  2 15:58:16 2025 daemon.notice hostapd: ACS: Survey for freq 5200 is missing noise floor

Image

Heres the netifd logs before and after restarting wifi

# Before
Mon Jun  2 15:39:09 2025 daemon.notice netifd: radio0 (2301): WARNING: Variable 'data' does not exist or is not an array/object
Mon Jun  2 15:39:09 2025 daemon.notice netifd: radio0 (2301): Phy not found
Mon Jun  2 15:39:09 2025 daemon.notice netifd: radio0 (2301): Could not find PHY for device 'radio0'
Mon Jun  2 15:39:09 2025 daemon.notice netifd: Wireless device 'radio0' set retry=0
Mon Jun  2 15:39:09 2025 daemon.crit netifd: Wireless device 'radio0' setup failed, retry=0
Mon Jun  2 15:39:09 2025 daemon.notice netifd: radio0 (2360): WARNING: Variable 'data' does not exist or is not an array/object
Mon Jun  2 15:39:09 2025 daemon.notice netifd: radio0 (2360): Bug: PHY is undefined for device 'radio0'
Mon Jun  2 15:39:09 2025 daemon.notice netifd: Wireless device 'radio0' is now down
Mon Jun  2 15:39:09 2025 daemon.notice netifd: Network device 'pppoe-wan' link is up
Mon Jun  2 15:39:09 2025 daemon.notice netifd: Interface 'wan' is now up
Mon Jun  2 15:39:23 2025 daemon.notice netifd: Interface 'wan6' is now up

# After
Mon Jun  2 15:58:07 2025 daemon.notice netifd: radio0 (5917): WARNING: Variable 'data' does not exist or is not an array/object
Mon Jun  2 15:58:09 2025 daemon.notice netifd: Wireless device 'radio0' is now up
Mon Jun  2 15:58:16 2025 daemon.notice netifd: Network device 'phy0-ap0' link is up

Here is my config

root@OpenWrt:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'pci0000:00/0000:00:10.0'
        option htmode 'HE20'
        option cell_density '0'
        option band '5g'
        option channel 'auto'
        option txpower '10'
        option country '**'

config wifi-iface 'wifinet0'
        option device 'radio0'
        option mode 'ap'
        option ssid 'OpenWrt5.0'
        option encryption 'psk2'
        option key '***'
        option network 'lan'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reboot failure and comparing the recorded dmesg, netifd, and hostapd output before and after manually restarting Wi-Fi. Inspect the MT7921E startup path and the radio0 handling shown in the logs. Done means the MT7922 access point starts automatically after boot without using LuCI or running wifi manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
networking, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.