Skip to content

Commit 10bc855

Browse files
author
Kalle Valo
committed
Merge tag 'ath-current-20240531' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath
Merge ath-current from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git fixes for 6.10. Two fixes for user reported regressions in ath11k. One dependency fix and one error path fix.
2 parents 92ecbb3 + 6e16782 commit 10bc855

4 files changed

Lines changed: 44 additions & 22 deletions

File tree

drivers/net/wireless/ath/ath10k/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ config ATH10K_SNOC
4545
depends on ATH10K
4646
depends on ARCH_QCOM || COMPILE_TEST
4747
depends on QCOM_SMEM
48+
depends on QCOM_RPROC_COMMON || QCOM_RPROC_COMMON=n
4849
select QCOM_SCM
4950
select QCOM_QMI_HELPERS
5051
help

drivers/net/wireless/ath/ath11k/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
604604
.coldboot_cal_ftm = true,
605605
.cbcal_restart_fw = false,
606606
.fw_mem_mode = 0,
607-
.num_vdevs = 16 + 1,
607+
.num_vdevs = 3,
608608
.num_peers = 512,
609609
.supports_suspend = false,
610610
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),

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

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7988,8 +7988,6 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
79887988
struct ath11k_base *ab = ar->ab;
79897989
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
79907990
int ret;
7991-
struct cur_regulatory_info *reg_info;
7992-
enum ieee80211_ap_reg_power power_type;
79937991

79947992
mutex_lock(&ar->conf_mutex);
79957993

@@ -8000,17 +7998,6 @@ ath11k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
80007998
if (ath11k_wmi_supports_6ghz_cc_ext(ar) &&
80017999
ctx->def.chan->band == NL80211_BAND_6GHZ &&
80028000
arvif->vdev_type == WMI_VDEV_TYPE_STA) {
8003-
reg_info = &ab->reg_info_store[ar->pdev_idx];
8004-
power_type = vif->bss_conf.power_type;
8005-
8006-
ath11k_dbg(ab, ATH11K_DBG_MAC, "chanctx power type %d\n", power_type);
8007-
8008-
if (power_type == IEEE80211_REG_UNSET_AP) {
8009-
ret = -EINVAL;
8010-
goto out;
8011-
}
8012-
8013-
ath11k_reg_handle_chan_list(ab, reg_info, power_type);
80148001
arvif->chanctx = *ctx;
80158002
ath11k_mac_parse_tx_pwr_env(ar, vif, ctx);
80168003
}
@@ -9626,6 +9613,8 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,
96269613
struct ath11k *ar = hw->priv;
96279614
struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
96289615
struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
9616+
enum ieee80211_ap_reg_power power_type;
9617+
struct cur_regulatory_info *reg_info;
96299618
struct ath11k_peer *peer;
96309619
int ret = 0;
96319620

@@ -9705,6 +9694,29 @@ static int ath11k_mac_op_sta_state(struct ieee80211_hw *hw,
97059694
ath11k_warn(ar->ab, "Unable to authorize peer %pM vdev %d: %d\n",
97069695
sta->addr, arvif->vdev_id, ret);
97079696
}
9697+
9698+
if (!ret &&
9699+
ath11k_wmi_supports_6ghz_cc_ext(ar) &&
9700+
arvif->vdev_type == WMI_VDEV_TYPE_STA &&
9701+
arvif->chanctx.def.chan &&
9702+
arvif->chanctx.def.chan->band == NL80211_BAND_6GHZ) {
9703+
reg_info = &ar->ab->reg_info_store[ar->pdev_idx];
9704+
power_type = vif->bss_conf.power_type;
9705+
9706+
if (power_type == IEEE80211_REG_UNSET_AP) {
9707+
ath11k_warn(ar->ab, "invalid power type %d\n",
9708+
power_type);
9709+
ret = -EINVAL;
9710+
} else {
9711+
ret = ath11k_reg_handle_chan_list(ar->ab,
9712+
reg_info,
9713+
power_type);
9714+
if (ret)
9715+
ath11k_warn(ar->ab,
9716+
"failed to handle chan list with power type %d\n",
9717+
power_type);
9718+
}
9719+
}
97089720
} else if (old_state == IEEE80211_STA_AUTHORIZED &&
97099721
new_state == IEEE80211_STA_ASSOC) {
97109722
spin_lock_bh(&ar->ab->base_lock);

drivers/net/wireless/ath/ath11k/pcic.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ static int ath11k_pcic_ext_irq_config(struct ath11k_base *ab)
561561
{
562562
int i, j, n, ret, num_vectors = 0;
563563
u32 user_base_data = 0, base_vector = 0;
564+
struct ath11k_ext_irq_grp *irq_grp;
564565
unsigned long irq_flags;
565566

566567
ret = ath11k_pcic_get_user_msi_assignment(ab, "DP", &num_vectors,
@@ -574,14 +575,16 @@ static int ath11k_pcic_ext_irq_config(struct ath11k_base *ab)
574575
irq_flags |= IRQF_NOBALANCING;
575576

576577
for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) {
577-
struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i];
578+
irq_grp = &ab->ext_irq_grp[i];
578579
u32 num_irq = 0;
579580

580581
irq_grp->ab = ab;
581582
irq_grp->grp_id = i;
582583
irq_grp->napi_ndev = alloc_netdev_dummy(0);
583-
if (!irq_grp->napi_ndev)
584-
return -ENOMEM;
584+
if (!irq_grp->napi_ndev) {
585+
ret = -ENOMEM;
586+
goto fail_allocate;
587+
}
585588

586589
netif_napi_add(irq_grp->napi_ndev, &irq_grp->napi,
587590
ath11k_pcic_ext_grp_napi_poll);
@@ -606,11 +609,8 @@ static int ath11k_pcic_ext_irq_config(struct ath11k_base *ab)
606609
int irq = ath11k_pcic_get_msi_irq(ab, vector);
607610

608611
if (irq < 0) {
609-
for (n = 0; n <= i; n++) {
610-
irq_grp = &ab->ext_irq_grp[n];
611-
free_netdev(irq_grp->napi_ndev);
612-
}
613-
return irq;
612+
ret = irq;
613+
goto fail_irq;
614614
}
615615

616616
ab->irq_num[irq_idx] = irq;
@@ -635,6 +635,15 @@ static int ath11k_pcic_ext_irq_config(struct ath11k_base *ab)
635635
}
636636

637637
return 0;
638+
fail_irq:
639+
/* i ->napi_ndev was properly allocated. Free it also */
640+
i += 1;
641+
fail_allocate:
642+
for (n = 0; n < i; n++) {
643+
irq_grp = &ab->ext_irq_grp[n];
644+
free_netdev(irq_grp->napi_ndev);
645+
}
646+
return ret;
638647
}
639648

640649
int ath11k_pcic_config_irq(struct ath11k_base *ab)

0 commit comments

Comments
 (0)