Skip to content

Commit 4c740c4

Browse files
committed
Merge tag 'ath-current-20251103' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
Jeff Johnson says: ================== ath.git update for v6.18-rc5 Revert an ath12k change which resulted in a significance performance impact on WCN7850. ================== Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 parents c74619e + 9222582 commit 4c740c4

File tree

1 file changed

+55
-67
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+55
-67
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,

0 commit comments

Comments
 (0)