Skip to content

Commit 7d1988a

Browse files
committed
Johannes Berg says: ==================== Just two small fixes: - ath12k: revert a change that caused performance regressions - hwsim: don't ignore netns on netlink socket matching * tag 'wireless-2025-11-05' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211_hwsim: Limit destroy_on_close radio removal to netgroup Revert "wifi: ath12k: Fix missing station power save configuration" ==================== Link: https://patch.msgid.link/20251105152827.53254-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 4d6ec3a + 4c740c4 commit 7d1988a

File tree

2 files changed

+59
-70
lines changed

2 files changed

+59
-70
lines changed

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 55 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4064,68 +4064,12 @@ static int ath12k_mac_fils_discovery(struct ath12k_link_vif *arvif,
40644064
return ret;
40654065
}
40664066

4067-
static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
4068-
{
4069-
struct ath12k *ar = arvif->ar;
4070-
struct ieee80211_vif *vif = arvif->ahvif->vif;
4071-
struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
4072-
enum wmi_sta_powersave_param param;
4073-
struct ieee80211_bss_conf *info;
4074-
enum wmi_sta_ps_mode psmode;
4075-
int ret;
4076-
int timeout;
4077-
bool enable_ps;
4078-
4079-
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
4080-
4081-
if (vif->type != NL80211_IFTYPE_STATION)
4082-
return;
4083-
4084-
enable_ps = arvif->ahvif->ps;
4085-
if (enable_ps) {
4086-
psmode = WMI_STA_PS_MODE_ENABLED;
4087-
param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
4088-
4089-
timeout = conf->dynamic_ps_timeout;
4090-
if (timeout == 0) {
4091-
info = ath12k_mac_get_link_bss_conf(arvif);
4092-
if (!info) {
4093-
ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
4094-
vif->addr, arvif->link_id);
4095-
return;
4096-
}
4097-
4098-
/* firmware doesn't like 0 */
4099-
timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
4100-
}
4101-
4102-
ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
4103-
timeout);
4104-
if (ret) {
4105-
ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
4106-
arvif->vdev_id, ret);
4107-
return;
4108-
}
4109-
} else {
4110-
psmode = WMI_STA_PS_MODE_DISABLED;
4111-
}
4112-
4113-
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
4114-
arvif->vdev_id, psmode ? "enable" : "disable");
4115-
4116-
ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
4117-
if (ret)
4118-
ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
4119-
psmode, arvif->vdev_id, ret);
4120-
}
4121-
41224067
static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
41234068
struct ieee80211_vif *vif,
41244069
u64 changed)
41254070
{
41264071
struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif);
41274072
unsigned long links = ahvif->links_map;
4128-
struct ieee80211_vif_cfg *vif_cfg;
41294073
struct ieee80211_bss_conf *info;
41304074
struct ath12k_link_vif *arvif;
41314075
struct ieee80211_sta *sta;
@@ -4189,24 +4133,61 @@ static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw,
41894133
}
41904134
}
41914135
}
4136+
}
41924137

4193-
if (changed & BSS_CHANGED_PS) {
4194-
links = ahvif->links_map;
4195-
vif_cfg = &vif->cfg;
4138+
static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif)
4139+
{
4140+
struct ath12k *ar = arvif->ar;
4141+
struct ieee80211_vif *vif = arvif->ahvif->vif;
4142+
struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf;
4143+
enum wmi_sta_powersave_param param;
4144+
struct ieee80211_bss_conf *info;
4145+
enum wmi_sta_ps_mode psmode;
4146+
int ret;
4147+
int timeout;
4148+
bool enable_ps;
41964149

4197-
for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
4198-
arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]);
4199-
if (!arvif || !arvif->ar)
4200-
continue;
4150+
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
42014151

4202-
ar = arvif->ar;
4152+
if (vif->type != NL80211_IFTYPE_STATION)
4153+
return;
4154+
4155+
enable_ps = arvif->ahvif->ps;
4156+
if (enable_ps) {
4157+
psmode = WMI_STA_PS_MODE_ENABLED;
4158+
param = WMI_STA_PS_PARAM_INACTIVITY_TIME;
42034159

4204-
if (ar->ab->hw_params->supports_sta_ps) {
4205-
ahvif->ps = vif_cfg->ps;
4206-
ath12k_mac_vif_setup_ps(arvif);
4160+
timeout = conf->dynamic_ps_timeout;
4161+
if (timeout == 0) {
4162+
info = ath12k_mac_get_link_bss_conf(arvif);
4163+
if (!info) {
4164+
ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n",
4165+
vif->addr, arvif->link_id);
4166+
return;
42074167
}
4168+
4169+
/* firmware doesn't like 0 */
4170+
timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000;
42084171
}
4172+
4173+
ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param,
4174+
timeout);
4175+
if (ret) {
4176+
ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n",
4177+
arvif->vdev_id, ret);
4178+
return;
4179+
}
4180+
} else {
4181+
psmode = WMI_STA_PS_MODE_DISABLED;
42094182
}
4183+
4184+
ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n",
4185+
arvif->vdev_id, psmode ? "enable" : "disable");
4186+
4187+
ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode);
4188+
if (ret)
4189+
ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n",
4190+
psmode, arvif->vdev_id, ret);
42104191
}
42114192

42124193
static bool ath12k_mac_supports_tpc(struct ath12k *ar, struct ath12k_vif *ahvif,
@@ -4228,6 +4209,7 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,
42284209
{
42294210
struct ath12k_vif *ahvif = arvif->ahvif;
42304211
struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif);
4212+
struct ieee80211_vif_cfg *vif_cfg = &vif->cfg;
42314213
struct cfg80211_chan_def def;
42324214
u32 param_id, param_value;
42334215
enum nl80211_band band;
@@ -4514,6 +4496,12 @@ static void ath12k_mac_bss_info_changed(struct ath12k *ar,
45144496
}
45154497

45164498
ath12k_mac_fils_discovery(arvif, info);
4499+
4500+
if (changed & BSS_CHANGED_PS &&
4501+
ar->ab->hw_params->supports_sta_ps) {
4502+
ahvif->ps = vif_cfg->ps;
4503+
ath12k_mac_vif_setup_ps(arvif);
4504+
}
45174505
}
45184506

45194507
static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif,

drivers/net/wireless/virtual/mac80211_hwsim.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6698,14 +6698,15 @@ static struct genl_family hwsim_genl_family __ro_after_init = {
66986698
.n_mcgrps = ARRAY_SIZE(hwsim_mcgrps),
66996699
};
67006700

6701-
static void remove_user_radios(u32 portid)
6701+
static void remove_user_radios(u32 portid, int netgroup)
67026702
{
67036703
struct mac80211_hwsim_data *entry, *tmp;
67046704
LIST_HEAD(list);
67056705

67066706
spin_lock_bh(&hwsim_radio_lock);
67076707
list_for_each_entry_safe(entry, tmp, &hwsim_radios, list) {
6708-
if (entry->destroy_on_close && entry->portid == portid) {
6708+
if (entry->destroy_on_close && entry->portid == portid &&
6709+
entry->netgroup == netgroup) {
67096710
list_move(&entry->list, &list);
67106711
rhashtable_remove_fast(&hwsim_radios_rht, &entry->rht,
67116712
hwsim_rht_params);
@@ -6730,7 +6731,7 @@ static int mac80211_hwsim_netlink_notify(struct notifier_block *nb,
67306731
if (state != NETLINK_URELEASE)
67316732
return NOTIFY_DONE;
67326733

6733-
remove_user_radios(notify->portid);
6734+
remove_user_radios(notify->portid, hwsim_net_get_netgroup(notify->net));
67346735

67356736
if (notify->portid == hwsim_net_get_wmediumd(notify->net)) {
67366737
printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink"

0 commit comments

Comments
 (0)