mt76_switch_vif_chanctx() cancels mac_work of each radio whose channel context changes, before it takes dev->mutex. Only the set_channel op of the driver queues mac_work again. If the channel update or the link move of a vif fails, or a later vif names no radio, the function returns before it sets the channel of the other radios, and their mac_work stays stopped until their next channel change. Station links on these radios then do not detect beacon loss. Reachable via a channel switch of vifs on several radios whose MCU command fails. Queue mac_work again for each radio whose channel the function did not set, as mt76_remain_on_channel() does for a request that it refuses. Fixes: 70869cc429ff ("wifi: mt76: fix handling channel context with different bands in mt76_switch_vif_chanctx()") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/channel.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/channel.c b/drivers/net/wireless/mediatek/mt76/channel.c index 23066307c92a..df655cc56349 100644 --- a/drivers/net/wireless/mediatek/mt76/channel.c +++ b/drivers/net/wireless/mediatek/mt76/channel.c @@ -216,8 +216,10 @@ int mt76_switch_vif_chanctx(struct ieee80211_hw *hw, else phy = new_ctx->phy; - if (!phy) - return -EINVAL; + if (!phy) { + ret = -EINVAL; + goto restart_mac_work; + } if (need_update[phy->band_idx]) continue; @@ -273,6 +275,11 @@ int mt76_switch_vif_chanctx(struct ieee80211_hw *hw, out: mutex_unlock(&dev->mutex); +restart_mac_work: + for (i = 0; i < ARRAY_SIZE(need_update); i++) + if (need_update[i] && dev->phys[i]) + mt76_phy_mac_work_restart(dev->phys[i]); + return ret; } EXPORT_SYMBOL_GPL(mt76_switch_vif_chanctx); -- 2.47.3