2023-05-08 08:29:35

by Greenman, Gregory

[permalink] [raw]
Subject: [PATCH 00/14] wifi: iwlwifi: updates intended for v6.4 2023-05-08

From: Gregory Greenman <[email protected]>

Hi,

Here's the first set of patches for v6.5
It contains the continuation of MLO work (mostly small fixes
and adjustments) as well as a few other small changes.

Thanks,
Gregory

Avraham Stern (1):
wifi: iwlwifi: mvm: support PASN for MLO

Emmanuel Grumbach (2):
wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
wifi: iwlwifi: pass the esr_transition_timeout to the firmware

Golan Ben Ami (1):
wifi: iwlwifi: cfg: freeze 22500 devices FW API

Gregory Greenman (1):
wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO

Haim Dreyfuss (1):
wifi: iwlwifi: don't silently ignore missing suspend or resume ops

Johannes Berg (6):
wifi: iwlwifi: mvm: make internal callback structs const
wifi: iwlwifi: mvm: always free dup_data
wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()
wifi: iwlwifi: mvm: don't double-init spinlock
wifi: iwlwifi: mvm: fix cancel_delayed_work_sync() deadlock
wifi: iwlwifi: mvm: fix number of concurrent link checks

Miri Korenblit (1):
wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware

Yedidya Benshimol (1):
wifi: iwlwifi: mvm: use link ID in missed beacon notification

.../net/wireless/intel/iwlwifi/cfg/22000.c | 20 +--
.../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 57 ++++++--
.../net/wireless/intel/iwlwifi/fw/api/mac.h | 22 +++-
.../net/wireless/intel/iwlwifi/iwl-trans.h | 4 +-
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 3 +
drivers/net/wireless/intel/iwlwifi/mvm/link.c | 18 ++-
.../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 94 +++++++++----
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 123 ++++++++----------
.../net/wireless/intel/iwlwifi/mvm/mld-key.c | 27 ++--
.../net/wireless/intel/iwlwifi/mvm/mld-mac.c | 13 +-
.../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 15 ++-
.../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 22 ++--
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 31 ++++-
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 46 +++++--
drivers/net/wireless/intel/iwlwifi/mvm/sta.h | 9 +-
.../net/wireless/intel/iwlwifi/mvm/utils.c | 20 +--
17 files changed, 342 insertions(+), 184 deletions(-)

--
2.38.1


2023-05-08 08:29:36

by Greenman, Gregory

[permalink] [raw]
Subject: [PATCH 05/14] wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()

From: Johannes Berg <[email protected]>

This wasn't really common anymore, so dissolve it, it has a
pretty strange calling convention that's confusing.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
---
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 90 ++++++++-----------
1 file changed, 37 insertions(+), 53 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 13bbc9a627b8..2ae665ba2ac9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1478,21 +1478,37 @@ iwl_mvm_chandef_get_primary_80(struct cfg80211_chan_def *chandef)
return (control_start - data_start) / 80;
}

-/*
- * Returns true if addding the interface is done
- * (either with success or failure)
- *
- * FIXME: remove this again and merge it in
- */
-static bool iwl_mvm_mac_add_interface_common(struct iwl_mvm *mvm,
- struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- int *ret)
+static int iwl_mvm_alloc_bcast_mcast_sta(struct iwl_mvm *mvm,
+ struct ieee80211_vif *vif)
{
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+ int ret;

lockdep_assert_held(&mvm->mutex);

+ ret = iwl_mvm_alloc_bcast_sta(mvm, vif);
+ if (ret) {
+ IWL_ERR(mvm, "Failed to allocate bcast sta\n");
+ return ret;
+ }
+
+ /* Only queue for this station is the mcast queue,
+ * which shouldn't be in TFD mask anyway
+ */
+ return iwl_mvm_allocate_int_sta(mvm, &mvmvif->deflink.mcast_sta, 0,
+ vif->type,
+ IWL_STA_MULTICAST);
+}
+
+static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
+ struct ieee80211_vif *vif)
+{
+ struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+ int ret;
+
+ mutex_lock(&mvm->mutex);
+
mvmvif->mvm = mvm;

/* the first link always points to the default one */
@@ -1510,12 +1526,18 @@ static bool iwl_mvm_mac_add_interface_common(struct iwl_mvm *mvm,
mvmvif->deflink.beacon_stats.num_beacons;

/* Allocate resources for the MAC context, and add it to the fw */
- *ret = iwl_mvm_mac_ctxt_init(mvm, vif);
- if (*ret)
- return true;
+ ret = iwl_mvm_mac_ctxt_init(mvm, vif);
+ if (ret)
+ goto out;

rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif);

+ /* Currently not much to do for NAN */
+ if (vif->type == NL80211_IFTYPE_NAN) {
+ ret = 0;
+ goto out;
+ }
+
/*
* The AP binding flow can be done only after the beacon
* template is configured (which happens only in the mac80211
@@ -1530,50 +1552,12 @@ static bool iwl_mvm_mac_add_interface_common(struct iwl_mvm *mvm,
if (vif->type == NL80211_IFTYPE_AP ||
vif->type == NL80211_IFTYPE_ADHOC) {
iwl_mvm_vif_dbgfs_register(mvm, vif);
- return true;
+ ret = 0;
+ goto out;
}

mvmvif->features |= hw->netdev_features;

- return false;
-}
-
-static int iwl_mvm_alloc_bcast_mcast_sta(struct iwl_mvm *mvm,
- struct ieee80211_vif *vif)
-{
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
- int ret;
-
- lockdep_assert_held(&mvm->mutex);
-
- ret = iwl_mvm_alloc_bcast_sta(mvm, vif);
- if (ret) {
- IWL_ERR(mvm, "Failed to allocate bcast sta\n");
- return ret;
- }
-
- /*
- * Only queue for this station is the mcast queue,
- * which shouldn't be in TFD mask anyway
- */
- return iwl_mvm_allocate_int_sta(mvm, &mvmvif->deflink.mcast_sta, 0,
- vif->type,
- IWL_STA_MULTICAST);
-}
-
-static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif)
-{
- struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
- int ret;
-
- mutex_lock(&mvm->mutex);
-
- /* Common for MLD and non-MLD API */
- if (iwl_mvm_mac_add_interface_common(mvm, hw, vif, &ret))
- goto out;
-
ret = iwl_mvm_mac_ctxt_add(mvm, vif);
if (ret)
goto out_unlock;
--
2.38.1

2023-05-08 08:29:42

by Greenman, Gregory

[permalink] [raw]
Subject: [PATCH 06/14] wifi: iwlwifi: mvm: don't double-init spinlock

From: Johannes Berg <[email protected]>

We don't need to (and shouldn't) initialize the spinlock
during HW restart that was already initialized, so move
that into the correct if block. Since then we have two
consecutive if statements with the same (though inverted)
condition, unify those as well.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
index f877be850589..19f1545b3c7e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
@@ -667,15 +667,15 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
ret = iwl_mvm_mld_alloc_sta_links(mvm, vif, sta);
if (ret)
return ret;
- }

- spin_lock_init(&mvm_sta->lock);
+ spin_lock_init(&mvm_sta->lock);

- if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))
- ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);
- else
ret = iwl_mvm_sta_init(mvm, vif, sta, IWL_MVM_INVALID_STA,
STATION_TYPE_PEER);
+ } else {
+ ret = iwl_mvm_alloc_sta_after_restart(mvm, vif, sta);
+ }
+
if (ret)
goto err;

--
2.38.1

2023-05-08 08:29:47

by Greenman, Gregory

[permalink] [raw]
Subject: [PATCH 09/14] wifi: iwlwifi: don't silently ignore missing suspend or resume ops

From: Haim Dreyfuss <[email protected]>

In case the driver doesn't implement suspend or resume operations
on the transport layer, notify the driver's upper layer.
Otherwise, we might access d3_status uninitialized.

Signed-off-by: Haim Dreyfuss <[email protected]>
Signed-off-by: Gregory Greenman <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index 9f1228b5a384..885581e636c7 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -1160,7 +1160,7 @@ static inline int iwl_trans_d3_suspend(struct iwl_trans *trans, bool test,
{
might_sleep();
if (!trans->ops->d3_suspend)
- return 0;
+ return -EOPNOTSUPP;

return trans->ops->d3_suspend(trans, test, reset);
}
@@ -1171,7 +1171,7 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans,
{
might_sleep();
if (!trans->ops->d3_resume)
- return 0;
+ return -EOPNOTSUPP;

return trans->ops->d3_resume(trans, status, test, reset);
}
--
2.38.1

2023-05-08 09:01:16

by Greenman, Gregory

[permalink] [raw]
Subject: Re: [PATCH 00/14] wifi: iwlwifi: updates intended for v6.4 2023-05-08

On Mon, 2023-05-08 at 11:24 +0300, [email protected] wrote:
> From: Gregory Greenman <[email protected]>
>
> Hi,
>
> Here's the first set of patches for v6.5
> It contains the continuation of MLO work (mostly small fixes
> and adjustments) as well as a few other small changes.
>
> Thanks,
> Gregory
>
> Avraham Stern (1):
>   wifi: iwlwifi: mvm: support PASN for MLO
>
> Emmanuel Grumbach (2):
>   wifi: iwlwifi: mvm: update the FW apis for LINK and MAC commands
>   wifi: iwlwifi: pass the esr_transition_timeout to the firmware
>
> Golan Ben Ami (1):
>   wifi: iwlwifi: cfg: freeze 22500 devices FW API
>
> Gregory Greenman (1):
>   wifi: iwlwifi: mvm: adjust csa notifications and commands to MLO
>
> Haim Dreyfuss (1):
>   wifi: iwlwifi: don't silently ignore missing suspend or resume ops
>
> Johannes Berg (6):
>   wifi: iwlwifi: mvm: make internal callback structs const
>   wifi: iwlwifi: mvm: always free dup_data
>   wifi: iwlwifi: mvm: dissolve iwl_mvm_mac_add_interface_common()
>   wifi: iwlwifi: mvm: don't double-init spinlock
>   wifi: iwlwifi: mvm: fix cancel_delayed_work_sync() deadlock
>   wifi: iwlwifi: mvm: fix number of concurrent link checks
>
> Miri Korenblit (1):
>   wifi: iwlwifi: mvm: Make iwl_mvm_diversity_iter() MLO aware
>
> Yedidya Benshimol (1):
>   wifi: iwlwifi: mvm: use link ID in missed beacon notification
>
>  .../net/wireless/intel/iwlwifi/cfg/22000.c    |  20 +--
>  .../wireless/intel/iwlwifi/fw/api/mac-cfg.h   |  57 ++++++--
>  .../net/wireless/intel/iwlwifi/fw/api/mac.h   |  22 +++-
>  .../net/wireless/intel/iwlwifi/iwl-trans.h    |   4 +-
>  drivers/net/wireless/intel/iwlwifi/mvm/fw.c   |   3 +
>  drivers/net/wireless/intel/iwlwifi/mvm/link.c |  18 ++-
>  .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c |  94 +++++++++----
>  .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 123 ++++++++----------
>  .../net/wireless/intel/iwlwifi/mvm/mld-key.c  |  27 ++--
>  .../net/wireless/intel/iwlwifi/mvm/mld-mac.c  |  13 +-
>  .../wireless/intel/iwlwifi/mvm/mld-mac80211.c |  15 ++-
>  .../net/wireless/intel/iwlwifi/mvm/mld-sta.c  |  22 ++--
>  drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  31 ++++-
>  drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |   2 +-
>  drivers/net/wireless/intel/iwlwifi/mvm/sta.c  |  46 +++++--
>  drivers/net/wireless/intel/iwlwifi/mvm/sta.h  |   9 +-
>  .../net/wireless/intel/iwlwifi/mvm/utils.c    |  20 +--
>  17 files changed, 342 insertions(+), 184 deletions(-)
>

I had a typo in the subject, updates for v6.5 of course.