Skip to content

Commit 453bfc2

Browse files
author
Kalle Valo
committed
Merge tag 'iwlwifi-for-kalle-2020-03-08' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes
First batch of fixes intended for v5.6 * Fix a locking issue in time events handling; * A fix in rate-scaling; * Fix for a potential NULL pointer deref; * Enable antenna diversity in some devices that were erroneously not doing it; * Allow FW dumps to continue when the FW is stuck; * A fix in the HE capabilities handling; * Another fix for FW dumps where we were reading wrong addresses.
2 parents 2362059 + 9352ed0 commit 453bfc2

File tree

6 files changed

+44
-30
lines changed

6 files changed

+44
-30
lines changed

drivers/net/wireless/intel/iwlwifi/cfg/22000.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ const struct iwl_cfg iwl_ax101_cfg_qu_c0_hr_b0 = {
283283
* HT size; mac80211 would otherwise pick the HE max (256) by default.
284284
*/
285285
.max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
286+
.tx_with_siso_diversity = true,
286287
.num_rbds = IWL_NUM_RBDS_22000_HE,
287288
};
288289

@@ -309,6 +310,7 @@ const struct iwl_cfg iwl_ax101_cfg_quz_hr = {
309310
* HT size; mac80211 would otherwise pick the HE max (256) by default.
310311
*/
311312
.max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT,
313+
.tx_with_siso_diversity = true,
312314
.num_rbds = IWL_NUM_RBDS_22000_HE,
313315
};
314316

drivers/net/wireless/intel/iwlwifi/fw/dbg.c

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
11-
* Copyright(c) 2018 - 2019 Intel Corporation
11+
* Copyright(c) 2018 - 2020 Intel Corporation
1212
*
1313
* This program is free software; you can redistribute it and/or modify
1414
* it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
3131
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3232
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3333
* Copyright(c) 2015 - 2017 Intel Deutschland GmbH
34-
* Copyright(c) 2018 - 2019 Intel Corporation
34+
* Copyright(c) 2018 - 2020 Intel Corporation
3535
* All rights reserved.
3636
*
3737
* Redistribution and use in source and binary forms, with or without
@@ -1409,11 +1409,7 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt,
14091409
goto out;
14101410
}
14111411

1412-
/*
1413-
* region register have absolute value so apply rxf offset after
1414-
* reading the registers
1415-
*/
1416-
offs += rxf_data.offset;
1412+
offs = rxf_data.offset;
14171413

14181414
/* Lock fence */
14191415
iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1);
@@ -2494,10 +2490,7 @@ static void iwl_fw_dbg_collect_sync(struct iwl_fw_runtime *fwrt, u8 wk_idx)
24942490
goto out;
24952491
}
24962492

2497-
if (iwl_fw_dbg_stop_restart_recording(fwrt, &params, true)) {
2498-
IWL_ERR(fwrt, "Failed to stop DBGC recording, aborting dump\n");
2499-
goto out;
2500-
}
2493+
iwl_fw_dbg_stop_restart_recording(fwrt, &params, true);
25012494

25022495
IWL_DEBUG_FW_INFO(fwrt, "WRT: Data collection start\n");
25032496
if (iwl_trans_dbg_ini_valid(fwrt->trans))
@@ -2662,14 +2655,14 @@ static int iwl_fw_dbg_restart_recording(struct iwl_trans *trans,
26622655
return 0;
26632656
}
26642657

2665-
int iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
2666-
struct iwl_fw_dbg_params *params,
2667-
bool stop)
2658+
void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
2659+
struct iwl_fw_dbg_params *params,
2660+
bool stop)
26682661
{
26692662
int ret = 0;
26702663

26712664
if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status))
2672-
return 0;
2665+
return;
26732666

26742667
if (fw_has_capa(&fwrt->fw->ucode_capa,
26752668
IWL_UCODE_TLV_CAPA_DBG_SUSPEND_RESUME_CMD_SUPP))
@@ -2686,7 +2679,5 @@ int iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
26862679
iwl_fw_set_dbg_rec_on(fwrt);
26872680
}
26882681
#endif
2689-
2690-
return ret;
26912682
}
26922683
IWL_EXPORT_SYMBOL(iwl_fw_dbg_stop_restart_recording);

drivers/net/wireless/intel/iwlwifi/fw/dbg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt,
239239
_iwl_fw_dbg_trigger_simple_stop((fwrt), (wdev), \
240240
iwl_fw_dbg_get_trigger((fwrt)->fw,\
241241
(trig)))
242-
int iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
243-
struct iwl_fw_dbg_params *params,
244-
bool stop);
242+
void iwl_fw_dbg_stop_restart_recording(struct iwl_fw_runtime *fwrt,
243+
struct iwl_fw_dbg_params *params,
244+
bool stop);
245245

246246
#ifdef CONFIG_IWLWIFI_DEBUGFS
247247
static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt)

drivers/net/wireless/intel/iwlwifi/iwl-drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
14671467
kmemdup(pieces->dbg_conf_tlv[i],
14681468
pieces->dbg_conf_tlv_len[i],
14691469
GFP_KERNEL);
1470-
if (!pieces->dbg_conf_tlv_len[i])
1470+
if (!pieces->dbg_conf_tlv[i])
14711471
goto out_free_fw;
14721472
}
14731473
}

drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* GPL LICENSE SUMMARY
77
*
88
* Copyright(c) 2017 Intel Deutschland GmbH
9-
* Copyright(c) 2018 - 2019 Intel Corporation
9+
* Copyright(c) 2018 - 2020 Intel Corporation
1010
*
1111
* This program is free software; you can redistribute it and/or modify
1212
* it under the terms of version 2 of the GNU General Public License as
@@ -27,7 +27,7 @@
2727
* BSD LICENSE
2828
*
2929
* Copyright(c) 2017 Intel Deutschland GmbH
30-
* Copyright(c) 2018 - 2019 Intel Corporation
30+
* Copyright(c) 2018 - 2020 Intel Corporation
3131
* All rights reserved.
3232
*
3333
* Redistribution and use in source and binary forms, with or without
@@ -147,7 +147,11 @@ static u16 rs_fw_get_config_flags(struct iwl_mvm *mvm,
147147
(vht_ena && (vht_cap->cap & IEEE80211_VHT_CAP_RXLDPC))))
148148
flags |= IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK;
149149

150-
/* consider our LDPC support in case of HE */
150+
/* consider LDPC support in case of HE */
151+
if (he_cap->has_he && (he_cap->he_cap_elem.phy_cap_info[1] &
152+
IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD))
153+
flags |= IWL_TLC_MNG_CFG_FLAGS_LDPC_MSK;
154+
151155
if (sband->iftype_data && sband->iftype_data->he_cap.has_he &&
152156
!(sband->iftype_data->he_cap.he_cap_elem.phy_cap_info[1] &
153157
IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD))
@@ -191,11 +195,13 @@ rs_fw_vht_set_enabled_rates(const struct ieee80211_sta *sta,
191195
{
192196
u16 supp;
193197
int i, highest_mcs;
198+
u8 nss = sta->rx_nss;
194199

195-
for (i = 0; i < sta->rx_nss; i++) {
196-
if (i == IWL_TLC_NSS_MAX)
197-
break;
200+
/* the station support only a single receive chain */
201+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
202+
nss = 1;
198203

204+
for (i = 0; i < nss && i < IWL_TLC_NSS_MAX; i++) {
199205
highest_mcs = rs_fw_vht_highest_rx_mcs_index(vht_cap, i + 1);
200206
if (!highest_mcs)
201207
continue;
@@ -241,8 +247,13 @@ rs_fw_he_set_enabled_rates(const struct ieee80211_sta *sta,
241247
u16 tx_mcs_160 =
242248
le16_to_cpu(sband->iftype_data->he_cap.he_mcs_nss_supp.tx_mcs_160);
243249
int i;
250+
u8 nss = sta->rx_nss;
251+
252+
/* the station support only a single receive chain */
253+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
254+
nss = 1;
244255

245-
for (i = 0; i < sta->rx_nss && i < IWL_TLC_NSS_MAX; i++) {
256+
for (i = 0; i < nss && i < IWL_TLC_NSS_MAX; i++) {
246257
u16 _mcs_160 = (mcs_160 >> (2 * i)) & 0x3;
247258
u16 _mcs_80 = (mcs_80 >> (2 * i)) & 0x3;
248259
u16 _tx_mcs_160 = (tx_mcs_160 >> (2 * i)) & 0x3;
@@ -303,8 +314,14 @@ static void rs_fw_set_supp_rates(struct ieee80211_sta *sta,
303314
cmd->mode = IWL_TLC_MNG_MODE_HT;
304315
cmd->ht_rates[IWL_TLC_NSS_1][IWL_TLC_HT_BW_NONE_160] =
305316
cpu_to_le16(ht_cap->mcs.rx_mask[0]);
306-
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
307-
cpu_to_le16(ht_cap->mcs.rx_mask[1]);
317+
318+
/* the station support only a single receive chain */
319+
if (sta->smps_mode == IEEE80211_SMPS_STATIC)
320+
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
321+
0;
322+
else
323+
cmd->ht_rates[IWL_TLC_NSS_2][IWL_TLC_HT_BW_NONE_160] =
324+
cpu_to_le16(ht_cap->mcs.rx_mask[1]);
308325
}
309326
}
310327

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
785785
if (!le32_to_cpu(notif->status)) {
786786
iwl_mvm_te_check_disconnect(mvm, vif,
787787
"Session protection failure");
788+
spin_lock_bh(&mvm->time_event_lock);
788789
iwl_mvm_te_clear_data(mvm, te_data);
790+
spin_unlock_bh(&mvm->time_event_lock);
789791
}
790792

791793
if (le32_to_cpu(notif->start)) {
@@ -801,7 +803,9 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
801803
*/
802804
iwl_mvm_te_check_disconnect(mvm, vif,
803805
"No beacon heard and the session protection is over already...");
806+
spin_lock_bh(&mvm->time_event_lock);
804807
iwl_mvm_te_clear_data(mvm, te_data);
808+
spin_unlock_bh(&mvm->time_event_lock);
805809
}
806810

807811
goto out_unlock;

0 commit comments

Comments
 (0)