Skip to content

Commit 107adc6

Browse files
committed
Merge tag 'wireless-drivers-2021-04-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo says: ==================== wireless-drivers fixes for v5.12 Third, and last, set of fixes for v5.12. Small fixes, iwlwifi having most of them. brcmfmac regression caused by cfg80211 changes is the most important here. iwlwifi * fix a lockdep warning * fix regulatory feature detection in certain firmware versions * new hardware support * fix lockdep warning * mvm: fix beacon protection checks mt76 * mt7921: fix airtime reporting brcmfmac * fix a deadlock regression ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3cf1482 + 65db391 commit 107adc6

File tree

13 files changed

+97
-55
lines changed

13 files changed

+97
-55
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2439,7 +2439,7 @@ void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool locked)
24392439
vif = ifp->vif;
24402440
cfg = wdev_to_cfg(&vif->wdev);
24412441
cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL;
2442-
if (locked) {
2442+
if (!locked) {
24432443
rtnl_lock();
24442444
wiphy_lock(cfg->wiphy);
24452445
cfg80211_unregister_wdev(&vif->wdev);

drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2005-2014 Intel Corporation
3+
* Copyright (C) 2005-2014, 2021 Intel Corporation
44
* Copyright (C) 2015-2017 Intel Deutschland GmbH
55
*/
66
#include <linux/sched.h>
@@ -26,7 +26,7 @@ bool iwl_notification_wait(struct iwl_notif_wait_data *notif_wait,
2626
if (!list_empty(&notif_wait->notif_waits)) {
2727
struct iwl_notification_wait *w;
2828

29-
spin_lock(&notif_wait->notif_wait_lock);
29+
spin_lock_bh(&notif_wait->notif_wait_lock);
3030
list_for_each_entry(w, &notif_wait->notif_waits, list) {
3131
int i;
3232
bool found = false;
@@ -59,7 +59,7 @@ bool iwl_notification_wait(struct iwl_notif_wait_data *notif_wait,
5959
triggered = true;
6060
}
6161
}
62-
spin_unlock(&notif_wait->notif_wait_lock);
62+
spin_unlock_bh(&notif_wait->notif_wait_lock);
6363
}
6464

6565
return triggered;
@@ -70,10 +70,10 @@ void iwl_abort_notification_waits(struct iwl_notif_wait_data *notif_wait)
7070
{
7171
struct iwl_notification_wait *wait_entry;
7272

73-
spin_lock(&notif_wait->notif_wait_lock);
73+
spin_lock_bh(&notif_wait->notif_wait_lock);
7474
list_for_each_entry(wait_entry, &notif_wait->notif_waits, list)
7575
wait_entry->aborted = true;
76-
spin_unlock(&notif_wait->notif_wait_lock);
76+
spin_unlock_bh(&notif_wait->notif_wait_lock);
7777

7878
wake_up_all(&notif_wait->notif_waitq);
7979
}

drivers/net/wireless/intel/iwlwifi/iwl-config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ struct iwl_cfg {
414414
#define IWL_CFG_MAC_TYPE_QNJ 0x36
415415
#define IWL_CFG_MAC_TYPE_SO 0x37
416416
#define IWL_CFG_MAC_TYPE_SNJ 0x42
417+
#define IWL_CFG_MAC_TYPE_SOF 0x43
417418
#define IWL_CFG_MAC_TYPE_MA 0x44
418419

419420
#define IWL_CFG_RF_TYPE_TH 0x105

drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ enum iwl_reg_capa_flags_v2 {
232232
REG_CAPA_V2_MCS_9_ALLOWED = BIT(6),
233233
REG_CAPA_V2_WEATHER_DISABLED = BIT(7),
234234
REG_CAPA_V2_40MHZ_ALLOWED = BIT(8),
235-
REG_CAPA_V2_11AX_DISABLED = BIT(13),
235+
REG_CAPA_V2_11AX_DISABLED = BIT(10),
236236
};
237237

238238
/*

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,10 +1786,13 @@ static ssize_t iwl_dbgfs_rfi_freq_table_write(struct iwl_mvm *mvm, char *buf,
17861786
return -EINVAL;
17871787

17881788
/* value zero triggers re-sending the default table to the device */
1789-
if (!op_id)
1789+
if (!op_id) {
1790+
mutex_lock(&mvm->mutex);
17901791
ret = iwl_rfi_send_config_cmd(mvm, NULL);
1791-
else
1792+
mutex_unlock(&mvm->mutex);
1793+
} else {
17921794
ret = -EOPNOTSUPP; /* in the future a new table will be added */
1795+
}
17931796

17941797
return ret ?: count;
17951798
}

drivers/net/wireless/intel/iwlwifi/mvm/rfi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2020 Intel Corporation
3+
* Copyright (C) 2020 - 2021 Intel Corporation
44
*/
55

66
#include "mvm.h"
@@ -66,6 +66,8 @@ int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_t
6666
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RFIM_SUPPORT))
6767
return -EOPNOTSUPP;
6868

69+
lockdep_assert_held(&mvm->mutex);
70+
6971
/* in case no table is passed, use the default one */
7072
if (!rfi_table) {
7173
memcpy(cmd.table, iwl_rfi_table, sizeof(cmd.table));
@@ -75,9 +77,7 @@ int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_t
7577
cmd.oem = 1;
7678
}
7779

78-
mutex_lock(&mvm->mutex);
7980
ret = iwl_mvm_send_cmd(mvm, &hcmd);
80-
mutex_unlock(&mvm->mutex);
8181

8282
if (ret)
8383
IWL_ERR(mvm, "Failed to send RFI config cmd %d\n", ret);

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,10 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,
272272
rx_status->chain_signal[2] = S8_MIN;
273273
}
274274

275-
static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
276-
struct ieee80211_hdr *hdr,
277-
struct iwl_rx_mpdu_desc *desc,
278-
u32 status)
275+
static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,
276+
struct ieee80211_hdr *hdr,
277+
struct iwl_rx_mpdu_desc *desc,
278+
u32 status)
279279
{
280280
struct iwl_mvm_sta *mvmsta;
281281
struct iwl_mvm_vif *mvmvif;
@@ -285,6 +285,9 @@ static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
285285
u32 len = le16_to_cpu(desc->mpdu_len);
286286
const u8 *frame = (void *)hdr;
287287

288+
if ((status & IWL_RX_MPDU_STATUS_SEC_MASK) == IWL_RX_MPDU_STATUS_SEC_NONE)
289+
return 0;
290+
288291
/*
289292
* For non-beacon, we don't really care. But beacons may
290293
* be filtered out, and we thus need the firmware's replay
@@ -356,6 +359,10 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
356359
IWL_RX_MPDU_STATUS_SEC_UNKNOWN && !mvm->monitor_on)
357360
return -1;
358361

362+
if (unlikely(ieee80211_is_mgmt(hdr->frame_control) &&
363+
!ieee80211_has_protected(hdr->frame_control)))
364+
return iwl_mvm_rx_mgmt_prot(sta, hdr, desc, status);
365+
359366
if (!ieee80211_has_protected(hdr->frame_control) ||
360367
(status & IWL_RX_MPDU_STATUS_SEC_MASK) ==
361368
IWL_RX_MPDU_STATUS_SEC_NONE)
@@ -411,7 +418,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
411418
stats->flag |= RX_FLAG_DECRYPTED;
412419
return 0;
413420
case RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC:
414-
return iwl_mvm_rx_mgmt_crypto(sta, hdr, desc, status);
421+
break;
415422
default:
416423
/*
417424
* Sometimes we can get frames that were not decrypted

drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2018-2020 Intel Corporation
3+
* Copyright (C) 2018-2021 Intel Corporation
44
*/
55
#include "iwl-trans.h"
66
#include "iwl-fh.h"
@@ -75,15 +75,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
7575
const struct fw_img *fw)
7676
{
7777
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
78-
u32 ltr_val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
79-
u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
80-
CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
81-
u32_encode_bits(250,
82-
CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
83-
CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
84-
u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
85-
CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
86-
u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
8778
struct iwl_context_info_gen3 *ctxt_info_gen3;
8879
struct iwl_prph_scratch *prph_scratch;
8980
struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl;
@@ -217,26 +208,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
217208
iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
218209
CSR_AUTO_FUNC_BOOT_ENA);
219210

220-
/*
221-
* To workaround hardware latency issues during the boot process,
222-
* initialize the LTR to ~250 usec (see ltr_val above).
223-
* The firmware initializes this again later (to a smaller value).
224-
*/
225-
if ((trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210 ||
226-
trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) &&
227-
!trans->trans_cfg->integrated) {
228-
iwl_write32(trans, CSR_LTR_LONG_VAL_AD, ltr_val);
229-
} else if (trans->trans_cfg->integrated &&
230-
trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) {
231-
iwl_write_prph(trans, HPM_MAC_LTR_CSR, HPM_MAC_LRT_ENABLE_ALL);
232-
iwl_write_prph(trans, HPM_UMAC_LTR, ltr_val);
233-
}
234-
235-
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
236-
iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
237-
else
238-
iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT);
239-
240211
return 0;
241212

242213
err_free_ctxt_info:

drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
33
* Copyright (C) 2017 Intel Deutschland GmbH
4-
* Copyright (C) 2018-2020 Intel Corporation
4+
* Copyright (C) 2018-2021 Intel Corporation
55
*/
66
#include "iwl-trans.h"
77
#include "iwl-fh.h"
@@ -240,7 +240,6 @@ int iwl_pcie_ctxt_info_init(struct iwl_trans *trans,
240240

241241
/* kick FW self load */
242242
iwl_write64(trans, CSR_CTXT_INFO_BA, trans_pcie->ctxt_info_dma_addr);
243-
iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);
244243

245244
/* Context info will be released upon alive or failure to get one */
246245

drivers/net/wireless/intel/iwlwifi/pcie/drv.c

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
592592
IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL),
593593
IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
594594
IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
595+
IWL_DEV_INFO(0x4DF0, 0x6074, iwl_ax201_cfg_qu_hr, NULL),
595596

596597
/* So with HR */
597598
IWL_DEV_INFO(0x2725, 0x0090, iwlax211_2ax_cfg_so_gf_a0, NULL),
@@ -1040,7 +1041,31 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
10401041
IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY,
10411042
IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
10421043
IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
1043-
iwl_cfg_so_a0_hr_a0, iwl_ax201_name)
1044+
iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
1045+
1046+
/* So-F with Hr */
1047+
_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
1048+
IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
1049+
IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
1050+
IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
1051+
iwl_cfg_so_a0_hr_a0, iwl_ax203_name),
1052+
_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
1053+
IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
1054+
IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY,
1055+
IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
1056+
iwl_cfg_so_a0_hr_a0, iwl_ax101_name),
1057+
_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
1058+
IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
1059+
IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
1060+
IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
1061+
iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
1062+
1063+
/* So-F with Gf */
1064+
_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
1065+
IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
1066+
IWL_CFG_RF_TYPE_GF, IWL_CFG_ANY,
1067+
IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
1068+
iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name),
10441069

10451070
#endif /* CONFIG_IWLMVM */
10461071
};

drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,34 @@ void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr)
266266
mutex_unlock(&trans_pcie->mutex);
267267
}
268268

269+
static void iwl_pcie_set_ltr(struct iwl_trans *trans)
270+
{
271+
u32 ltr_val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
272+
u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
273+
CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
274+
u32_encode_bits(250,
275+
CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
276+
CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
277+
u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
278+
CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
279+
u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
280+
281+
/*
282+
* To workaround hardware latency issues during the boot process,
283+
* initialize the LTR to ~250 usec (see ltr_val above).
284+
* The firmware initializes this again later (to a smaller value).
285+
*/
286+
if ((trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210 ||
287+
trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) &&
288+
!trans->trans_cfg->integrated) {
289+
iwl_write32(trans, CSR_LTR_LONG_VAL_AD, ltr_val);
290+
} else if (trans->trans_cfg->integrated &&
291+
trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) {
292+
iwl_write_prph(trans, HPM_MAC_LTR_CSR, HPM_MAC_LRT_ENABLE_ALL);
293+
iwl_write_prph(trans, HPM_UMAC_LTR, ltr_val);
294+
}
295+
}
296+
269297
int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
270298
const struct fw_img *fw, bool run_in_rfkill)
271299
{
@@ -332,6 +360,13 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
332360
if (ret)
333361
goto out;
334362

363+
iwl_pcie_set_ltr(trans);
364+
365+
if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
366+
iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
367+
else
368+
iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);
369+
335370
/* re-check RF-Kill state since we may have missed the interrupt */
336371
hw_rfkill = iwl_pcie_check_hw_rf_kill(trans);
337372
if (hw_rfkill && !run_in_rfkill)

drivers/net/wireless/intel/iwlwifi/pcie/tx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
928928
u32 cmd_pos;
929929
const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD];
930930
u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD];
931+
unsigned long flags;
931932

932933
if (WARN(!trans->wide_cmd_header &&
933934
group_id > IWL_ALWAYS_LONG_GROUP,
@@ -1011,10 +1012,10 @@ int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
10111012
goto free_dup_buf;
10121013
}
10131014

1014-
spin_lock_bh(&txq->lock);
1015+
spin_lock_irqsave(&txq->lock, flags);
10151016

10161017
if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) {
1017-
spin_unlock_bh(&txq->lock);
1018+
spin_unlock_irqrestore(&txq->lock, flags);
10181019

10191020
IWL_ERR(trans, "No space in command queue\n");
10201021
iwl_op_mode_cmd_queue_full(trans->op_mode);
@@ -1174,7 +1175,7 @@ int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans,
11741175
unlock_reg:
11751176
spin_unlock(&trans_pcie->reg_lock);
11761177
out:
1177-
spin_unlock_bh(&txq->lock);
1178+
spin_unlock_irqrestore(&txq->lock, flags);
11781179
free_dup_buf:
11791180
if (idx < 0)
11801181
kfree(dup_buf);

drivers/net/wireless/mediatek/mt76/mt7921/regs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@
135135

136136
#define MT_WTBLON_TOP_BASE 0x34000
137137
#define MT_WTBLON_TOP(ofs) (MT_WTBLON_TOP_BASE + (ofs))
138-
#define MT_WTBLON_TOP_WDUCR MT_WTBLON_TOP(0x0)
138+
#define MT_WTBLON_TOP_WDUCR MT_WTBLON_TOP(0x200)
139139
#define MT_WTBLON_TOP_WDUCR_GROUP GENMASK(2, 0)
140140

141-
#define MT_WTBL_UPDATE MT_WTBLON_TOP(0x030)
141+
#define MT_WTBL_UPDATE MT_WTBLON_TOP(0x230)
142142
#define MT_WTBL_UPDATE_WLAN_IDX GENMASK(9, 0)
143143
#define MT_WTBL_UPDATE_ADM_COUNT_CLEAR BIT(12)
144144
#define MT_WTBL_UPDATE_BUSY BIT(31)

0 commit comments

Comments
 (0)