2021-02-05 09:15:18

by Luca Coelho

[permalink] [raw]
Subject: [RESEND PATCH 00/12] iwlwifi: updates intended for v5.12 2021-01-31

From: Luca Coelho <[email protected]>

(resending because issues with spamcop seem to have prevented the
patches from reaching patchwork and possibly others)

Hi,

Here's the third set of patches intended for v5.12. It's the usual
development, new features, cleanups and bugfixes.

The changes are:

* One more CSA bug fix, this time in the AP side;
* Bump fW API support;
* Support for new So devices and a bit of reorg;
* Some other clean-ups and small fixes.

As usual, I'm pushing this to a pending branch, for kbuild bot, and
will send a pull-request later.

Please review.

Cheers,
Luca.

Emmanuel Grumbach (2):
iwlwifi: mvm: cancel the scan delayed work when scan is aborted
iwlwifi: mvm: fix CSA AP side

Ilan Peer (1):
iwlwifi: pcie: Disable softirqs during Rx queue init

Johannes Berg (4):
iwlwifi: mvm: advertise BIGTK client support if available
iwlwifi: fw api: make hdr a zero-size array again
iwlwifi: mvm: slightly clean up rs_fw_set_supp_rates()
iwlwifi: mvm: make iwl_mvm_tt_temp_changed() static

Luca Coelho (5):
iwlwifi: bump FW API to 60 for AX devices
iwlwifi: move SnJ and So rules to the new tables
iwlwifi: add support for SnJ with Jf devices
iwlwifi: mvm: move early time-point before nvm_init in non-unified
iwlwifi: pcie: add support for SnJ with Hr1

.../net/wireless/intel/iwlwifi/cfg/22000.c | 58 ++++++-
.../net/wireless/intel/iwlwifi/fw/api/rx.h | 7 +-
.../net/wireless/intel/iwlwifi/fw/api/tx.h | 2 +-
drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 +
.../net/wireless/intel/iwlwifi/iwl-config.h | 7 +-
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 +-
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 13 ++
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 5 +-
.../net/wireless/intel/iwlwifi/mvm/rs-fw.c | 5 +-
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 116 ++++++++++++--
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 3 +
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 19 ++-
drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 2 +-
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 141 ++++++++++++------
drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 36 ++---
15 files changed, 325 insertions(+), 95 deletions(-)

--
2.30.0


2021-02-05 09:23:06

by Luca Coelho

[permalink] [raw]
Subject: [RESEND PATCH 11/12] iwlwifi: mvm: make iwl_mvm_tt_temp_changed() static

From: Johannes Berg <[email protected]>

This is only needed within tt.c, make it static.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 -
drivers/net/wireless/intel/iwlwifi/mvm/tt.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 4925792257d1..308ba2e961e7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1906,7 +1906,6 @@ int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id,

/* Thermal management and CT-kill */
void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff);
-void iwl_mvm_tt_temp_changed(struct iwl_mvm *mvm, u32 temp);
void iwl_mvm_temp_notif(struct iwl_mvm *mvm,
struct iwl_rx_cmd_buffer *rxb);
void iwl_mvm_tt_handler(struct iwl_mvm *mvm);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 9dfe0381cbeb..790bc68a515a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -44,7 +44,7 @@ static void iwl_mvm_exit_ctkill(struct iwl_mvm *mvm)
iwl_mvm_set_hw_ctkill_state(mvm, false);
}

-void iwl_mvm_tt_temp_changed(struct iwl_mvm *mvm, u32 temp)
+static void iwl_mvm_tt_temp_changed(struct iwl_mvm *mvm, u32 temp)
{
/* ignore the notification if we are in test mode */
if (mvm->temperature_test)
--
2.30.0

2021-02-05 09:26:08

by Luca Coelho

[permalink] [raw]
Subject: [RESEND PATCH 12/12] iwlwifi: mvm: fix CSA AP side

From: Emmanuel Grumbach <[email protected]>

Once the all the stations completed the switch, we need
to clear csa_tx_blocked_vif. This was missing. We also
need to re-enable the broadcast / multicast stations.

Signed-off-by: Emmanuel Grumbach <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 31 +++++++++++++++++++
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 11 ++++---
2 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 7b0b7d191fc5..c21736f80c29 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -1634,6 +1634,23 @@ static inline u8 iwl_mvm_nl80211_band_from_rx_msdu(u8 phy_band)
}
}

+struct iwl_rx_sta_csa {
+ bool all_sta_unblocked;
+ struct ieee80211_vif *vif;
+};
+
+static void iwl_mvm_rx_get_sta_block_tx(void *data, struct ieee80211_sta *sta)
+{
+ struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
+ struct iwl_rx_sta_csa *rx_sta_csa = data;
+
+ if (mvmsta->vif != rx_sta_csa->vif)
+ return;
+
+ if (mvmsta->disable_tx)
+ rx_sta_csa->all_sta_unblocked = false;
+}
+
void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
struct iwl_rx_cmd_buffer *rxb, int queue)
{
@@ -1863,10 +1880,24 @@ void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
if (unlikely(tx_blocked_vif) && tx_blocked_vif == vif) {
struct iwl_mvm_vif *mvmvif =
iwl_mvm_vif_from_mac80211(tx_blocked_vif);
+ struct iwl_rx_sta_csa rx_sta_csa = {
+ .all_sta_unblocked = true,
+ .vif = tx_blocked_vif,
+ };

if (mvmvif->csa_target_freq == rx_status->freq)
iwl_mvm_sta_modify_disable_tx_ap(mvm, sta,
false);
+ ieee80211_iterate_stations_atomic(mvm->hw,
+ iwl_mvm_rx_get_sta_block_tx,
+ &rx_sta_csa);
+
+ if (rx_sta_csa.all_sta_unblocked) {
+ RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL);
+ /* Unblock BCAST / MCAST station */
+ iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false);
+ cancel_delayed_work_sync(&mvm->cs_tx_unblock_dwork);
+ }
}

rs_update_last_rssi(mvm, mvmsta, rx_status);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 2050cb4a0d18..4a8a15dbb1a4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright (C) 2012-2015, 2018-2020 Intel Corporation
+ * Copyright (C) 2012-2015, 2018-2021 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
@@ -3811,7 +3811,7 @@ static void iwl_mvm_int_sta_modify_disable_tx(struct iwl_mvm *mvm,
};
int ret;

- ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, 0,
+ ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC,
iwl_mvm_add_sta_cmd_size(mvm), &cmd);
if (ret)
IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret);
@@ -3825,12 +3825,11 @@ void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
struct iwl_mvm_sta *mvm_sta;
int i;

- lockdep_assert_held(&mvm->mutex);
+ rcu_read_lock();

/* Block/unblock all the stations of the given mvmvif */
for (i = 0; i < mvm->fw->ucode_capa.num_stations; i++) {
- sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[i],
- lockdep_is_held(&mvm->mutex));
+ sta = rcu_dereference(mvm->fw_id_to_mac_id[i]);
if (IS_ERR_OR_NULL(sta))
continue;

@@ -3842,6 +3841,8 @@ void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
iwl_mvm_sta_modify_disable_tx_ap(mvm, sta, disable);
}

+ rcu_read_unlock();
+
if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE))
return;

--
2.30.0

2021-02-05 09:33:58

by Luca Coelho

[permalink] [raw]
Subject: [RESEND PATCH 10/12] iwlwifi: pcie: Disable softirqs during Rx queue init

From: Ilan Peer <[email protected]>

When Rx queues are configured during module init, NAPI is enabled
while the Rx queue lock is held. However, since softirqs are not
disabled, it is possible that and IRQ would fire and call
iwl_pcie_rx_handle() which would also try to acquire the Rx lock.

Prevent this by disabling softirqs during Rx queue configuration,
as part of module init flow.

Signed-off-by: Ilan Peer <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 36 ++++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index e3e53419b526..407809c7e958 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -301,7 +301,7 @@ static void iwl_pcie_rxsq_restock(struct iwl_trans *trans,
if (!test_bit(STATUS_DEVICE_ENABLED, &trans->status))
return;

- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);
while ((iwl_rxq_space(rxq) > 0) && (rxq->free_count)) {
__le32 *bd = (__le32 *)rxq->bd;
/* The overwritten rxb must be a used one */
@@ -320,14 +320,14 @@ static void iwl_pcie_rxsq_restock(struct iwl_trans *trans,
rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
rxq->free_count--;
}
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);

/* If we've added more space for the firmware to place data, tell it.
* Increment device's write pointer in multiples of 8. */
if (rxq->write_actual != (rxq->write & ~0x7)) {
- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);
iwl_pcie_rxq_inc_wr_ptr(trans, rxq);
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
}
}

@@ -433,28 +433,28 @@ void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans, gfp_t priority,
while (1) {
unsigned int offset;

- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);
if (list_empty(&rxq->rx_used)) {
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
return;
}
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);

page = iwl_pcie_rx_alloc_page(trans, &offset, priority);
if (!page)
return;

- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);

if (list_empty(&rxq->rx_used)) {
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
__free_pages(page, trans_pcie->rx_page_order);
return;
}
rxb = list_first_entry(&rxq->rx_used, struct iwl_rx_mem_buffer,
list);
list_del(&rxb->list);
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);

BUG_ON(rxb->page);
rxb->page = page;
@@ -466,19 +466,19 @@ void iwl_pcie_rxq_alloc_rbs(struct iwl_trans *trans, gfp_t priority,
DMA_FROM_DEVICE);
if (dma_mapping_error(trans->dev, rxb->page_dma)) {
rxb->page = NULL;
- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);
list_add(&rxb->list, &rxq->rx_used);
- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
__free_pages(page, trans_pcie->rx_page_order);
return;
}

- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);

list_add_tail(&rxb->list, &rxq->rx_free);
rxq->free_count++;

- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
}
}

@@ -1112,7 +1112,7 @@ static int _iwl_pcie_rx_init(struct iwl_trans *trans)
for (i = 0; i < trans->num_rx_queues; i++) {
struct iwl_rxq *rxq = &trans_pcie->rxq[i];

- spin_lock(&rxq->lock);
+ spin_lock_bh(&rxq->lock);
/*
* Set read write pointer to reflect that we have processed
* and used all buffers, but have not restocked the Rx queue
@@ -1148,7 +1148,7 @@ static int _iwl_pcie_rx_init(struct iwl_trans *trans)
napi_enable(&rxq->napi);
}

- spin_unlock(&rxq->lock);
+ spin_unlock_bh(&rxq->lock);
}

/* move the pool to the default queue and allocator ownerships */
@@ -1190,9 +1190,9 @@ int iwl_pcie_rx_init(struct iwl_trans *trans)

iwl_pcie_rxq_restock(trans, trans_pcie->rxq);

- spin_lock(&trans_pcie->rxq->lock);
+ spin_lock_bh(&trans_pcie->rxq->lock);
iwl_pcie_rxq_inc_wr_ptr(trans, trans_pcie->rxq);
- spin_unlock(&trans_pcie->rxq->lock);
+ spin_unlock_bh(&trans_pcie->rxq->lock);

return 0;
}
--
2.30.0

2021-02-05 10:08:11

by Luca Coelho

[permalink] [raw]
Subject: Re: [RESEND PATCH 10/12] iwlwifi: pcie: Disable softirqs during Rx queue init

Luca Coelho <[email protected]> wrote:

> From: Ilan Peer <[email protected]>
>
> When Rx queues are configured during module init, NAPI is enabled
> while the Rx queue lock is held. However, since softirqs are not
> disabled, it is possible that and IRQ would fire and call
> iwl_pcie_rx_handle() which would also try to acquire the Rx lock.
>
> Prevent this by disabling softirqs during Rx queue configuration,
> as part of module init flow.
>
> Signed-off-by: Ilan Peer <[email protected]>
> Signed-off-by: Luca Coelho <[email protected]>

Patch applied to iwlwifi-next.git, thanks.

47ef328c2090 iwlwifi: pcie: Disable softirqs during Rx queue init