Skip to content

Commit

Permalink
wifi: mt76: mt7915: fix power-limits while chan_switch
Browse files Browse the repository at this point in the history
[ Upstream commit 6c0570b ]

If user changes the channel without completely disabling the interface the
txpower_sku values reported track the old channel the device was operating on.
If user bounces the interface the correct power tables are applied.

mt7915_sku_group_len array gets updated before the channel switch happens so it
uses data from the old channel.

Fixes: ecb187a ("mt76: mt7915: rework the flow of txpower setting")
Fixes: f1d9623 ("mt76: mt7915: implement HE per-rate tx power support")
Reported-By: Chad Monroe <chad.monroe@smartrg.com>
Tested-by: Chad Monroe <chad.monroe@smartrg.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ryderlee1110 authored and gregkh committed Sep 13, 2023
1 parent 2dd5c7f commit 49b6db8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7915/main.c
Expand Up @@ -455,7 +455,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
ieee80211_wake_queues(hw);
}

if (changed & IEEE80211_CONF_CHANGE_POWER) {
if (changed & (IEEE80211_CONF_CHANGE_POWER |
IEEE80211_CONF_CHANGE_CHANNEL)) {
ret = mt7915_mcu_set_txpower_sku(phy);
if (ret)
return ret;
Expand Down

0 comments on commit 49b6db8

Please sign in to comment.