All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2
@ 2021-03-26 10:57 Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags Luca Coelho
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Luca Coelho <luciano.coelho@intel.com>

Hi,

This is the v2 of the first patchset with fixes for v5.12.  This new version
removes the Change-Id tags that mistakenly got out.

The changes are:

* A few locking fixes;
* Fix a workaround for devices of the 22000 family;
* Fix the position of a bit in the regulatory capabilities;
* Add support to some devices that were missing.

As usual, I'm pushing this to a pending branch, for kbuild bot.  And
since these are fixes for the rc series, please take them directly to
wireless-drivers.git, as we agreed.  I'll assign them to you.

Cheers,
Luca.


Gregory Greenman (1):
  mvm: rfi: don't lock mvm->mutex when sending config command

Johannes Berg (3):
  iwlwifi: pcie: properly set LTR workarounds on 22000 devices
  iwlwifi: fw: fix notification wait locking
  iwlwifi: mvm: fix beacon protection checks

Luca Coelho (2):
  iwlwifi: fix 11ax disabled bit in the regulatory capability flags
  iwlwifi: pcie: add support for So-F devices

Matt Chen (1):
  iwlwifi: add support for Qu with AX201 device

 .../wireless/intel/iwlwifi/fw/notif-wait.c    | 10 +++---
 .../net/wireless/intel/iwlwifi/iwl-config.h   |  1 +
 .../wireless/intel/iwlwifi/iwl-nvm-parse.c    |  2 +-
 .../net/wireless/intel/iwlwifi/mvm/debugfs.c  |  7 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/rfi.c  |  6 ++--
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++++---
 .../intel/iwlwifi/pcie/ctxt-info-gen3.c       | 31 +---------------
 .../wireless/intel/iwlwifi/pcie/ctxt-info.c   |  3 +-
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 27 +++++++++++++-
 .../wireless/intel/iwlwifi/pcie/trans-gen2.c  | 35 +++++++++++++++++++
 10 files changed, 90 insertions(+), 49 deletions(-)

-- 
2.31.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-04-06 10:27   ` Kalle Valo
  2021-03-26 10:57 ` [PATCH v2 for v5.12 2/7] iwlwifi: pcie: properly set LTR workarounds on 22000 devices Luca Coelho
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Luca Coelho <luciano.coelho@intel.com>

When version 2 of the regulatory capability flags API was implemented,
the flag to disable 11ax was defined as bit 13, but this was later
changed and the bit remained as bit 10, like in version 1.  This was
never changed in the driver, so we were checking for the wrong bit in
newer devices.  Fix it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Fixes: e27c506a985c ("iwlwifi: regulatory: regulatory capabilities api change")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index af684f80b0cc..c5a1e84dc1ab 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -232,7 +232,7 @@ enum iwl_reg_capa_flags_v2 {
 	REG_CAPA_V2_MCS_9_ALLOWED	= BIT(6),
 	REG_CAPA_V2_WEATHER_DISABLED	= BIT(7),
 	REG_CAPA_V2_40MHZ_ALLOWED	= BIT(8),
-	REG_CAPA_V2_11AX_DISABLED	= BIT(13),
+	REG_CAPA_V2_11AX_DISABLED	= BIT(10),
 };
 
 /*
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 2/7] iwlwifi: pcie: properly set LTR workarounds on 22000 devices
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 3/7] iwlwifi: add support for Qu with AX201 device Luca Coelho
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

As the context info gen3 code is only called for >=AX210 devices
(from iwl_trans_pcie_gen2_start_fw()) the code there to set LTR
on 22000 devices cannot actually do anything (22000 < AX210).

Fix this by moving the LTR code to iwl_trans_pcie_gen2_start_fw()
where it can handle both devices. This then requires that we kick
the firmware only after that rather than doing it from the context
info code.

Note that this again had a dead branch in gen3 code, which I've
removed here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: ed0022da8bd9 ("iwlwifi: pcie: set LTR on more devices")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../intel/iwlwifi/pcie/ctxt-info-gen3.c       | 31 +---------------
 .../wireless/intel/iwlwifi/pcie/ctxt-info.c   |  3 +-
 .../wireless/intel/iwlwifi/pcie/trans-gen2.c  | 35 +++++++++++++++++++
 3 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
index 8fba190e84cf..cecc32e7dbe8 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info-gen3.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2018-2020 Intel Corporation
+ * Copyright (C) 2018-2021 Intel Corporation
  */
 #include "iwl-trans.h"
 #include "iwl-fh.h"
@@ -75,15 +75,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
 				 const struct fw_img *fw)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
-	u32 ltr_val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
-		      u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
-				      CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
-		      u32_encode_bits(250,
-				      CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
-		      CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
-		      u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
-				      CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
-		      u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
 	struct iwl_context_info_gen3 *ctxt_info_gen3;
 	struct iwl_prph_scratch *prph_scratch;
 	struct iwl_prph_scratch_ctrl_cfg *prph_sc_ctrl;
@@ -217,26 +208,6 @@ int iwl_pcie_ctxt_info_gen3_init(struct iwl_trans *trans,
 	iwl_set_bit(trans, CSR_CTXT_INFO_BOOT_CTRL,
 		    CSR_AUTO_FUNC_BOOT_ENA);
 
-	/*
-	 * To workaround hardware latency issues during the boot process,
-	 * initialize the LTR to ~250 usec (see ltr_val above).
-	 * The firmware initializes this again later (to a smaller value).
-	 */
-	if ((trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210 ||
-	     trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) &&
-	    !trans->trans_cfg->integrated) {
-		iwl_write32(trans, CSR_LTR_LONG_VAL_AD, ltr_val);
-	} else if (trans->trans_cfg->integrated &&
-		   trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) {
-		iwl_write_prph(trans, HPM_MAC_LTR_CSR, HPM_MAC_LRT_ENABLE_ALL);
-		iwl_write_prph(trans, HPM_UMAC_LTR, ltr_val);
-	}
-
-	if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
-		iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
-	else
-		iwl_set_bit(trans, CSR_GP_CNTRL, CSR_AUTO_FUNC_INIT);
-
 	return 0;
 
 err_free_ctxt_info:
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
index d1bb273d6b6d..74ce31fdf45e 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/ctxt-info.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
  * Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2020 Intel Corporation
+ * Copyright (C) 2018-2021 Intel Corporation
  */
 #include "iwl-trans.h"
 #include "iwl-fh.h"
@@ -240,7 +240,6 @@ int iwl_pcie_ctxt_info_init(struct iwl_trans *trans,
 
 	/* kick FW self load */
 	iwl_write64(trans, CSR_CTXT_INFO_BA, trans_pcie->ctxt_info_dma_addr);
-	iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);
 
 	/* Context info will be released upon alive or failure to get one */
 
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
index 497ef3405da3..94ffc1ae484d 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
@@ -266,6 +266,34 @@ void iwl_trans_pcie_gen2_fw_alive(struct iwl_trans *trans, u32 scd_addr)
 	mutex_unlock(&trans_pcie->mutex);
 }
 
+static void iwl_pcie_set_ltr(struct iwl_trans *trans)
+{
+	u32 ltr_val = CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ |
+		      u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+				      CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE) |
+		      u32_encode_bits(250,
+				      CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL) |
+		      CSR_LTR_LONG_VAL_AD_SNOOP_REQ |
+		      u32_encode_bits(CSR_LTR_LONG_VAL_AD_SCALE_USEC,
+				      CSR_LTR_LONG_VAL_AD_SNOOP_SCALE) |
+		      u32_encode_bits(250, CSR_LTR_LONG_VAL_AD_SNOOP_VAL);
+
+	/*
+	 * To workaround hardware latency issues during the boot process,
+	 * initialize the LTR to ~250 usec (see ltr_val above).
+	 * The firmware initializes this again later (to a smaller value).
+	 */
+	if ((trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_AX210 ||
+	     trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) &&
+	    !trans->trans_cfg->integrated) {
+		iwl_write32(trans, CSR_LTR_LONG_VAL_AD, ltr_val);
+	} else if (trans->trans_cfg->integrated &&
+		   trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_22000) {
+		iwl_write_prph(trans, HPM_MAC_LTR_CSR, HPM_MAC_LRT_ENABLE_ALL);
+		iwl_write_prph(trans, HPM_UMAC_LTR, ltr_val);
+	}
+}
+
 int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
 				 const struct fw_img *fw, bool run_in_rfkill)
 {
@@ -332,6 +360,13 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
 	if (ret)
 		goto out;
 
+	iwl_pcie_set_ltr(trans);
+
+	if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
+		iwl_write_umac_prph(trans, UREG_CPU_INIT_RUN, 1);
+	else
+		iwl_write_prph(trans, UREG_CPU_INIT_RUN, 1);
+
 	/* re-check RF-Kill state since we may have missed the interrupt */
 	hw_rfkill = iwl_pcie_check_hw_rf_kill(trans);
 	if (hw_rfkill && !run_in_rfkill)
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 3/7] iwlwifi: add support for Qu with AX201 device
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 2/7] iwlwifi: pcie: properly set LTR workarounds on 22000 devices Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 4/7] iwlwifi: fw: fix notification wait locking Luca Coelho
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Matt Chen <matt.chen@intel.com>

Add this specific Samsung AX201 sku to driver so it can be
detected and initialized successfully.

Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index ffaf973dae94..4e2219b46db2 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -592,6 +592,7 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
 	IWL_DEV_INFO(0x4DF0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, NULL),
 	IWL_DEV_INFO(0x4DF0, 0x2074, iwl_ax201_cfg_qu_hr, NULL),
 	IWL_DEV_INFO(0x4DF0, 0x4070, iwl_ax201_cfg_qu_hr, NULL),
+	IWL_DEV_INFO(0x4DF0, 0x6074, iwl_ax201_cfg_qu_hr, NULL),
 
 	/* So with HR */
 	IWL_DEV_INFO(0x2725, 0x0090, iwlax211_2ax_cfg_so_gf_a0, NULL),
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 4/7] iwlwifi: fw: fix notification wait locking
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
                   ` (2 preceding siblings ...)
  2021-03-26 10:57 ` [PATCH v2 for v5.12 3/7] iwlwifi: add support for Qu with AX201 device Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 5/7] iwlwifi: pcie: add support for So-F devices Luca Coelho
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Since we now call iwl_notification_wait_notify() from the
NAPI poll in soft-IRQ, we get a (valid) lockdep complaint
that we could get a deadlock by taking the spinlock from
sleeping context and then getting the soft-IRQ that also
tries to take it (in NAPI polling).

Fix this by disabling soft-IRQs for this lock.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: 25edc8f259c7 ("iwlwifi: pcie: properly implement NAPI")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c b/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c
index 3dbc6f3f92cc..231d2517f398 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/notif-wait.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2005-2014 Intel Corporation
+ * Copyright (C) 2005-2014, 2021 Intel Corporation
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
 #include <linux/sched.h>
@@ -26,7 +26,7 @@ bool iwl_notification_wait(struct iwl_notif_wait_data *notif_wait,
 	if (!list_empty(&notif_wait->notif_waits)) {
 		struct iwl_notification_wait *w;
 
-		spin_lock(&notif_wait->notif_wait_lock);
+		spin_lock_bh(&notif_wait->notif_wait_lock);
 		list_for_each_entry(w, &notif_wait->notif_waits, list) {
 			int i;
 			bool found = false;
@@ -59,7 +59,7 @@ bool iwl_notification_wait(struct iwl_notif_wait_data *notif_wait,
 				triggered = true;
 			}
 		}
-		spin_unlock(&notif_wait->notif_wait_lock);
+		spin_unlock_bh(&notif_wait->notif_wait_lock);
 	}
 
 	return triggered;
@@ -70,10 +70,10 @@ void iwl_abort_notification_waits(struct iwl_notif_wait_data *notif_wait)
 {
 	struct iwl_notification_wait *wait_entry;
 
-	spin_lock(&notif_wait->notif_wait_lock);
+	spin_lock_bh(&notif_wait->notif_wait_lock);
 	list_for_each_entry(wait_entry, &notif_wait->notif_waits, list)
 		wait_entry->aborted = true;
-	spin_unlock(&notif_wait->notif_wait_lock);
+	spin_unlock_bh(&notif_wait->notif_wait_lock);
 
 	wake_up_all(&notif_wait->notif_waitq);
 }
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 5/7] iwlwifi: pcie: add support for So-F devices
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
                   ` (3 preceding siblings ...)
  2021-03-26 10:57 ` [PATCH v2 for v5.12 4/7] iwlwifi: fw: fix notification wait locking Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 6/7] mvm: rfi: don't lock mvm->mutex when sending config command Luca Coelho
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Luca Coelho <luciano.coelho@intel.com>

We have a new type of device that has a different MAC ID, but is
otherwise identical to So devices.  Add rules to match this new ID
accordingly.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/iwl-config.h   |  1 +
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 26 ++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 75f99ff7f908..c4f5da76f1c0 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -414,6 +414,7 @@ struct iwl_cfg {
 #define IWL_CFG_MAC_TYPE_QNJ		0x36
 #define IWL_CFG_MAC_TYPE_SO		0x37
 #define IWL_CFG_MAC_TYPE_SNJ		0x42
+#define IWL_CFG_MAC_TYPE_SOF		0x43
 #define IWL_CFG_MAC_TYPE_MA		0x44
 
 #define IWL_CFG_RF_TYPE_TH		0x105
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 4e2219b46db2..558a0b2ef0fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1041,7 +1041,31 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
 		      IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY,
 		      IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
 		      IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
-		      iwl_cfg_so_a0_hr_a0, iwl_ax201_name)
+		      iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
+
+/* So-F with Hr */
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+		      IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
+		      IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      iwl_cfg_so_a0_hr_a0, iwl_ax203_name),
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+		      IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY,
+		      IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      iwl_cfg_so_a0_hr_a0, iwl_ax101_name),
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+		      IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
+		      IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
+
+/* So-F with Gf */
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+		      IWL_CFG_RF_TYPE_GF, IWL_CFG_ANY,
+		      IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+		      iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name),
 
 #endif /* CONFIG_IWLMVM */
 };
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 6/7] mvm: rfi: don't lock mvm->mutex when sending config command
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
                   ` (4 preceding siblings ...)
  2021-03-26 10:57 ` [PATCH v2 for v5.12 5/7] iwlwifi: pcie: add support for So-F devices Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-26 10:57 ` [PATCH v2 for v5.12 7/7] iwlwifi: mvm: fix beacon protection checks Luca Coelho
  2021-03-27 10:12 ` [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Sedat Dilek
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Gregory Greenman <gregory.greenman@intel.com>

The mutex is already locked in iwl_mvm_mac_start.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Fixes: 21254908cbe9 ("iwlwifi: mvm: add RFI-M support")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 7 +++++--
 drivers/net/wireless/intel/iwlwifi/mvm/rfi.c     | 6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 130760572262..34ddef97b099 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1786,10 +1786,13 @@ static ssize_t iwl_dbgfs_rfi_freq_table_write(struct iwl_mvm *mvm, char *buf,
 		return -EINVAL;
 
 	/* value zero triggers re-sending the default table to the device */
-	if (!op_id)
+	if (!op_id) {
+		mutex_lock(&mvm->mutex);
 		ret = iwl_rfi_send_config_cmd(mvm, NULL);
-	else
+		mutex_unlock(&mvm->mutex);
+	} else {
 		ret = -EOPNOTSUPP; /* in the future a new table will be added */
+	}
 
 	return ret ?: count;
 }
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c b/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
index 873919048143..0b818067067c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2020 Intel Corporation
+ * Copyright (C) 2020 - 2021 Intel Corporation
  */
 
 #include "mvm.h"
@@ -66,6 +66,8 @@ int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_t
 	if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RFIM_SUPPORT))
 		return -EOPNOTSUPP;
 
+	lockdep_assert_held(&mvm->mutex);
+
 	/* in case no table is passed, use the default one */
 	if (!rfi_table) {
 		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
 		cmd.oem = 1;
 	}
 
-	mutex_lock(&mvm->mutex);
 	ret = iwl_mvm_send_cmd(mvm, &hcmd);
-	mutex_unlock(&mvm->mutex);
 
 	if (ret)
 		IWL_ERR(mvm, "Failed to send RFI config cmd %d\n", ret);
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 for v5.12 7/7] iwlwifi: mvm: fix beacon protection checks
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
                   ` (5 preceding siblings ...)
  2021-03-26 10:57 ` [PATCH v2 for v5.12 6/7] mvm: rfi: don't lock mvm->mutex when sending config command Luca Coelho
@ 2021-03-26 10:57 ` Luca Coelho
  2021-03-27 10:12 ` [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Sedat Dilek
  7 siblings, 0 replies; 10+ messages in thread
From: Luca Coelho @ 2021-03-26 10:57 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Unfortunately, since beacon protection isn't fully available
yet, we didn't notice that there are problems with it and
that the replay detection isn't working correctly. We were
relying only on mac80211, since iwl_mvm_rx_crypto() exits
when !ieee80211_has_protected(), which is of course true for
protected (but not encrypted) management frames.

Fix this to properly detect protected (but not encrypted)
management frames and handle them - we continue to only care
about beacons since for others everything can and will be
checked in mac80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Fixes: b1fdc2505abc ("iwlwifi: mvm: advertise BIGTK client support if available")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index c21736f80c29..af5a6dd81c41 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -272,10 +272,10 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,
 	rx_status->chain_signal[2] = S8_MIN;
 }
 
-static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
-				  struct ieee80211_hdr *hdr,
-				  struct iwl_rx_mpdu_desc *desc,
-				  u32 status)
+static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,
+				struct ieee80211_hdr *hdr,
+				struct iwl_rx_mpdu_desc *desc,
+				u32 status)
 {
 	struct iwl_mvm_sta *mvmsta;
 	struct iwl_mvm_vif *mvmvif;
@@ -285,6 +285,9 @@ static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
 	u32 len = le16_to_cpu(desc->mpdu_len);
 	const u8 *frame = (void *)hdr;
 
+	if ((status & IWL_RX_MPDU_STATUS_SEC_MASK) == IWL_RX_MPDU_STATUS_SEC_NONE)
+		return 0;
+
 	/*
 	 * For non-beacon, we don't really care. But beacons may
 	 * 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,
 	    IWL_RX_MPDU_STATUS_SEC_UNKNOWN && !mvm->monitor_on)
 		return -1;
 
+	if (unlikely(ieee80211_is_mgmt(hdr->frame_control) &&
+		     !ieee80211_has_protected(hdr->frame_control)))
+		return iwl_mvm_rx_mgmt_prot(sta, hdr, desc, status);
+
 	if (!ieee80211_has_protected(hdr->frame_control) ||
 	    (status & IWL_RX_MPDU_STATUS_SEC_MASK) ==
 	    IWL_RX_MPDU_STATUS_SEC_NONE)
@@ -411,7 +418,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 		stats->flag |= RX_FLAG_DECRYPTED;
 		return 0;
 	case RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC:
-		return iwl_mvm_rx_mgmt_crypto(sta, hdr, desc, status);
+		break;
 	default:
 		/*
 		 * Sometimes we can get frames that were not decrypted
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2
  2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
                   ` (6 preceding siblings ...)
  2021-03-26 10:57 ` [PATCH v2 for v5.12 7/7] iwlwifi: mvm: fix beacon protection checks Luca Coelho
@ 2021-03-27 10:12 ` Sedat Dilek
  7 siblings, 0 replies; 10+ messages in thread
From: Sedat Dilek @ 2021-03-27 10:12 UTC (permalink / raw)
  To: Luca Coelho; +Cc: kvalo, linux-wireless

On Fri, Mar 26, 2021 at 11:58 AM Luca Coelho <luca@coelho.fi> wrote:
>
> From: Luca Coelho <luciano.coelho@intel.com>
>
> Hi,
>
> This is the v2 of the first patchset with fixes for v5.12.  This new version
> removes the Change-Id tags that mistakenly got out.
>
> The changes are:
>
> * A few locking fixes;
> * Fix a workaround for devices of the 22000 family;
> * Fix the position of a bit in the regulatory capabilities;
> * Add support to some devices that were missing.
>
> As usual, I'm pushing this to a pending branch, for kbuild bot.  And
> since these are fixes for the rc series, please take them directly to
> wireless-drivers.git, as we agreed.  I'll assign them to you.
>

Thanks for the updated patchset v2.

Is it possible to have v2 in <iwlwifi.git#iwlwifi-fixes> without the
by-accident-added "Change-Id:" tags as in [1].
For easy fetching.

Thanks.

- Sedat -

[1] https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git/log/?h=iwlwifi-sent-for-review-2021-03-26

>
>
> Gregory Greenman (1):
>   mvm: rfi: don't lock mvm->mutex when sending config command
>
> Johannes Berg (3):
>   iwlwifi: pcie: properly set LTR workarounds on 22000 devices
>   iwlwifi: fw: fix notification wait locking
>   iwlwifi: mvm: fix beacon protection checks
>
> Luca Coelho (2):
>   iwlwifi: fix 11ax disabled bit in the regulatory capability flags
>   iwlwifi: pcie: add support for So-F devices
>
> Matt Chen (1):
>   iwlwifi: add support for Qu with AX201 device
>
>  .../wireless/intel/iwlwifi/fw/notif-wait.c    | 10 +++---
>  .../net/wireless/intel/iwlwifi/iwl-config.h   |  1 +
>  .../wireless/intel/iwlwifi/iwl-nvm-parse.c    |  2 +-
>  .../net/wireless/intel/iwlwifi/mvm/debugfs.c  |  7 ++--
>  drivers/net/wireless/intel/iwlwifi/mvm/rfi.c  |  6 ++--
>  drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++++---
>  .../intel/iwlwifi/pcie/ctxt-info-gen3.c       | 31 +---------------
>  .../wireless/intel/iwlwifi/pcie/ctxt-info.c   |  3 +-
>  drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 27 +++++++++++++-
>  .../wireless/intel/iwlwifi/pcie/trans-gen2.c  | 35 +++++++++++++++++++
>  10 files changed, 90 insertions(+), 49 deletions(-)
>
> --
> 2.31.0
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags
  2021-03-26 10:57 ` [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags Luca Coelho
@ 2021-04-06 10:27   ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2021-04-06 10:27 UTC (permalink / raw)
  To: Luca Coelho; +Cc: linux-wireless

Luca Coelho <luca@coelho.fi> wrote:

> From: Luca Coelho <luciano.coelho@intel.com>
> 
> When version 2 of the regulatory capability flags API was implemented,
> the flag to disable 11ax was defined as bit 13, but this was later
> changed and the bit remained as bit 10, like in version 1.  This was
> never changed in the driver, so we were checking for the wrong bit in
> newer devices.  Fix it.
> 
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> Fixes: e27c506a985c ("iwlwifi: regulatory: regulatory capabilities api change")
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

7 patches applied to wireless-drivers.git, thanks.

07cc40fec9a8 iwlwifi: fix 11ax disabled bit in the regulatory capability flags
25628bc08d45 iwlwifi: pcie: properly set LTR workarounds on 22000 devices
97195d3cad85 iwlwifi: add support for Qu with AX201 device
9c04fd95fa83 iwlwifi: fw: fix notification wait locking
08f4b0b1c07b iwlwifi: pcie: add support for So-F devices
39fb06f79142 iwlwifi: mvm: rfi: don't lock mvm->mutex when sending config command
65db391dd874 iwlwifi: mvm: fix beacon protection checks

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/iwlwifi.20210326125611.6d28516b59cd.Id0248d5e4662695254f49ce37b0268834ed52918@changeid/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-04-06 10:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 10:57 [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 1/7] iwlwifi: fix 11ax disabled bit in the regulatory capability flags Luca Coelho
2021-04-06 10:27   ` Kalle Valo
2021-03-26 10:57 ` [PATCH v2 for v5.12 2/7] iwlwifi: pcie: properly set LTR workarounds on 22000 devices Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 3/7] iwlwifi: add support for Qu with AX201 device Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 4/7] iwlwifi: fw: fix notification wait locking Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 5/7] iwlwifi: pcie: add support for So-F devices Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 6/7] mvm: rfi: don't lock mvm->mutex when sending config command Luca Coelho
2021-03-26 10:57 ` [PATCH v2 for v5.12 7/7] iwlwifi: mvm: fix beacon protection checks Luca Coelho
2021-03-27 10:12 ` [PATCH v2 for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26 v2 Sedat Dilek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.