Skip to content

Conversation

@zbowling
Copy link

@zbowling zbowling commented Jan 1, 2026

This PR adds error handling for critical MCU commands in the MT7925 driver.

Problem

Several MCU commands in the MT7925 driver ignore return values, which could leave
the driver and firmware in inconsistent states when commands fail.

Changes

Patch 1: AMPDU MCU Error Handling

  • Check return values of mt7925_mcu_uni_rx_ba() and mt7925_mcu_uni_tx_ba()
  • Propagate errors from block aggregation setup/teardown
  • Only call completion callback if MCU command succeeded

Patch 2: Station Add BSS Info Error Handling

  • Check return value of mt7925_mcu_add_bss_info() in mt7925_mac_link_sta_add()
  • Prevent station creation if BSS info setup fails
  • Avoids inconsistent state where station exists without BSS config

Patch 3: Key Setup BSS Info Error Handling

  • Check return value of mt7925_mcu_add_bss_info() during cipher setup
  • Ensure BSS cipher configuration succeeds before key programming
  • Prevents keys being programmed for misconfigured BSS

Testing

Tested on Framework Desktop (AMD Ryzen AI Max 300 Series) with MT7925 WiFi.
These fixes complement the mutex fixes in PR #1029 and NULL checks in PR #1030.

Related

Check return values of mt7925_mcu_uni_rx_ba() and mt7925_mcu_uni_tx_ba()
in mt7925_ampdu_action() and propagate errors to the caller.

Previously, failures in these MCU commands were silently ignored, which
could leave block aggregation in an inconsistent state between the driver
and firmware.

For IEEE80211_AMPDU_TX_STOP_CONT, only call the completion callback
ieee80211_stop_tx_ba_cb_irqsafe() if the MCU command succeeded, to avoid
signaling completion when the firmware operation failed.

Reported-by: Zac Bowling <zac@zacbowling.com>
Signed-off-by: Zac Bowling <zac@zacbowling.com>
…a_add

Check return value of mt7925_mcu_add_bss_info() in mt7925_mac_link_sta_add()
and propagate errors to the caller.

BSS info must be set up before adding a station record. If this MCU
command fails, continuing with station add would leave the firmware in
an inconsistent state with a station but no BSS configuration.

Reported-by: Zac Bowling <zac@zacbowling.com>
Signed-off-by: Zac Bowling <zac@zacbowling.com>
Check return value of mt7925_mcu_add_bss_info() in mt7925_set_key_link()
when setting up cipher for the first time and propagate errors.

The BSS info update with cipher information must succeed before key
programming can proceed. If this MCU command fails, continuing with
key setup would program keys into the firmware for a BSS that doesn't
have the correct cipher configuration.

Reported-by: Zac Bowling <zac@zacbowling.com>
Signed-off-by: Zac Bowling <zac@zacbowling.com>
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

Successfully merging this pull request may close these issues.

1 participant