* [PATCH mt76 v2] wifi: mt76: mt7996: limit work in set_bitrate_mask
@ 2026-04-08 14:50 dylan.eskew
2026-04-09 10:48 ` Lorenzo Bianconi
0 siblings, 1 reply; 2+ messages in thread
From: dylan.eskew @ 2026-04-08 14:50 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee
Cc: linux-wireless, shayne.chen, sean.wang, Dylan Eskew
From: Dylan Eskew <dylan.eskew@candelatech.com>
Calls to mt7996_set_bitrate_mask() would propagate work for all stations
on the ieee80211_hw regardless of the vif specified in the call. To
prevent unnecessary work in FW, limit setting the sta_rate to only the
specified vif in mt7996_sta_rate_ctrl_update().
Fixes: afff4325548f0 ("wifi: mt76: mt7996: Use proper link_id in link_sta_rc_update callback")
Signed-off-by: Dylan Eskew <dylan.eskew@candelatech.com>
---
v2:
- Assign to correct tree
- Fix spelling error in commit message
---
drivers/net/wireless/mediatek/mt76/mt7996/main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
index a8a6552d49f6..26b8c91db0a8 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
@@ -1959,7 +1959,11 @@ static void mt7996_sta_rate_ctrl_update(void *data, struct ieee80211_sta *sta)
{
struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
struct mt7996_sta_link *msta_link;
- u32 *changed = data;
+ struct mt7996_vif *mvif = data;
+ u32 changed = IEEE80211_RC_SUPP_RATES_CHANGED;
+
+ if (msta->vif != mvif)
+ return;
msta_link = rcu_dereference(msta->link[msta->deflink_id]);
if (msta_link)
@@ -1972,7 +1976,6 @@ mt7996_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
{
struct mt7996_dev *dev = mt7996_hw_dev(hw);
struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
- u32 changed = IEEE80211_RC_SUPP_RATES_CHANGED;
mvif->deflink.bitrate_mask = *mask;
@@ -1985,7 +1988,7 @@ mt7996_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
* then multiple MCS setting (MCS 4,5,6) is not supported.
*/
ieee80211_iterate_stations_atomic(hw, mt7996_sta_rate_ctrl_update,
- &changed);
+ mvif);
ieee80211_queue_work(hw, &dev->rc_work);
return 0;
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH mt76 v2] wifi: mt76: mt7996: limit work in set_bitrate_mask
2026-04-08 14:50 [PATCH mt76 v2] wifi: mt76: mt7996: limit work in set_bitrate_mask dylan.eskew
@ 2026-04-09 10:48 ` Lorenzo Bianconi
0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Bianconi @ 2026-04-09 10:48 UTC (permalink / raw)
To: dylan.eskew; +Cc: nbd, ryder.lee, linux-wireless, shayne.chen, sean.wang
[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]
> From: Dylan Eskew <dylan.eskew@candelatech.com>
>
> Calls to mt7996_set_bitrate_mask() would propagate work for all stations
> on the ieee80211_hw regardless of the vif specified in the call. To
> prevent unnecessary work in FW, limit setting the sta_rate to only the
> specified vif in mt7996_sta_rate_ctrl_update().
>
> Fixes: afff4325548f0 ("wifi: mt76: mt7996: Use proper link_id in link_sta_rc_update callback")
> Signed-off-by: Dylan Eskew <dylan.eskew@candelatech.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
> v2:
> - Assign to correct tree
> - Fix spelling error in commit message
> ---
> drivers/net/wireless/mediatek/mt76/mt7996/main.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> index a8a6552d49f6..26b8c91db0a8 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c
> @@ -1959,7 +1959,11 @@ static void mt7996_sta_rate_ctrl_update(void *data, struct ieee80211_sta *sta)
> {
> struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
> struct mt7996_sta_link *msta_link;
> - u32 *changed = data;
> + struct mt7996_vif *mvif = data;
> + u32 changed = IEEE80211_RC_SUPP_RATES_CHANGED;
> +
> + if (msta->vif != mvif)
> + return;
>
> msta_link = rcu_dereference(msta->link[msta->deflink_id]);
> if (msta_link)
> @@ -1972,7 +1976,6 @@ mt7996_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> {
> struct mt7996_dev *dev = mt7996_hw_dev(hw);
> struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv;
> - u32 changed = IEEE80211_RC_SUPP_RATES_CHANGED;
>
> mvif->deflink.bitrate_mask = *mask;
>
> @@ -1985,7 +1988,7 @@ mt7996_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> * then multiple MCS setting (MCS 4,5,6) is not supported.
> */
> ieee80211_iterate_stations_atomic(hw, mt7996_sta_rate_ctrl_update,
> - &changed);
> + mvif);
> ieee80211_queue_work(hw, &dev->rc_work);
>
> return 0;
> --
> 2.52.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-09 10:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 14:50 [PATCH mt76 v2] wifi: mt76: mt7996: limit work in set_bitrate_mask dylan.eskew
2026-04-09 10:48 ` Lorenzo Bianconi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox