]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
wifi: iwlwifi: mvm: use the new lockdep-checking macros
authorJohannes Berg <johannes.berg@intel.com>
Wed, 29 Mar 2023 07:05:27 +0000 (10:05 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 30 Mar 2023 10:08:41 +0000 (12:08 +0200)
Use the new macros from mac80211 that do lockdep checking
on the RCU dereferences, instead of hard-coding 1 as the
argument to rcu_dereference_protected().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230329100039.112df5c8dec2.I1a1008f5566e509953d988f254d15c9e58630418@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c

index 98c9402716485d58e7f8c2a643863648acadde1e..7fb00220e6cc732bbf785766e182fd7fb41682f2 100644 (file)
@@ -3591,9 +3591,9 @@ static void iwl_mvm_rs_rate_init_all_links(struct iwl_mvm *mvm,
 
        for_each_mvm_vif_valid_link(mvmvif, link_id) {
                struct ieee80211_bss_conf *conf =
-                       rcu_dereference_protected(vif->link_conf[link_id], 1);
+                       link_conf_dereference_protected(vif, link_id);
                struct ieee80211_link_sta *link_sta =
-                       rcu_dereference_protected(sta->link[link_id], 1);
+                       link_sta_dereference_protected(sta, link_id);
 
                if (!conf || !link_sta || !mvmvif->link[link_id]->phy_ctxt)
                        continue;
@@ -3622,9 +3622,9 @@ static bool iwl_mvm_vif_conf_from_sta(struct iwl_mvm *mvm,
        for_each_set_bit(i, (unsigned long *)&sta->valid_links,
                         IEEE80211_MLD_MAX_NUM_LINKS) {
                struct ieee80211_link_sta *link_sta =
-                       rcu_dereference_protected(sta->link[i], 1);
+                       link_sta_dereference_protected(sta, i);
                struct ieee80211_bss_conf *link_conf =
-                       rcu_dereference_protected(vif->link_conf[i], 1);
+                       link_conf_dereference_protected(vif, i);
 
                if (!link_conf || !link_sta)
                        continue;
@@ -3653,9 +3653,9 @@ static void iwl_mvm_vif_set_he_support(struct ieee80211_hw *hw,
        for_each_set_bit(i, (unsigned long *)&sta->valid_links,
                         IEEE80211_MLD_MAX_NUM_LINKS) {
                struct ieee80211_link_sta *link_sta =
-                       rcu_dereference_protected(sta->link[i], 1);
+                       link_sta_dereference_protected(sta, i);
                struct ieee80211_bss_conf *link_conf =
-                       rcu_dereference_protected(vif->link_conf[i], 1);
+                       link_conf_dereference_protected(vif, i);
 
                if (!link_conf || !link_sta || !mvmvif->link[i])
                        continue;
@@ -3753,7 +3753,7 @@ iwl_mvm_sta_state_auth_to_assoc(struct ieee80211_hw *hw,
                for_each_set_bit(i, (unsigned long *)&sta->valid_links,
                                 IEEE80211_MLD_MAX_NUM_LINKS) {
                        struct ieee80211_bss_conf *link_conf =
-                               rcu_dereference_protected(vif->link_conf[i], 1);
+                               link_conf_dereference_protected(vif, i);
 
                        if (WARN_ON(!link_conf))
                                return -EINVAL;
index 8ed76fc83702709efb164eb868a8a08b6f82576e..ddc09012549bd3b26655591b8f15bf26d8943575 100644 (file)
@@ -921,9 +921,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
                if (added & BIT(i)) {
                        struct ieee80211_bss_conf *link_conf;
 
-                       /* FIXME: allow use of sdata_dereference()? */
-                       link_conf = rcu_dereference_protected(vif->link_conf[i],
-                                                             1);
+                       link_conf = link_conf_dereference_protected(vif, i);
                        if (WARN_ON(!link_conf))
                                continue;
 
index a713b8a10781f019acfb753a7a08785b0114570a..34b85a9a27afa0ebb5c9dc3e09ef7e1b777b2530 100644 (file)
@@ -499,7 +499,7 @@ static int iwl_mvm_mld_alloc_sta_link(struct iwl_mvm *mvm,
                                      unsigned int link_id)
 {
        struct ieee80211_link_sta *link_sta =
-               rcu_dereference_protected(sta->link[link_id], 1);
+               link_sta_dereference_protected(sta, link_id);
        struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta);
        struct iwl_mvm_link_sta *link;
        u32 sta_id = iwl_mvm_find_free_sta_id(mvm,
@@ -654,7 +654,7 @@ int iwl_mvm_mld_add_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
        for_each_sta_active_link(vif, sta, link_sta, link_id) {
                struct ieee80211_bss_conf *link_conf =
-                       rcu_dereference_protected(vif->link_conf[link_id], 1);
+                       link_conf_dereference_protected(vif, link_id);
                struct iwl_mvm_link_sta *mvm_link_sta =
                        rcu_dereference_protected(mvm_sta->link[link_id],
                                                  lockdep_is_held(&mvm->mutex));
@@ -704,7 +704,7 @@ int iwl_mvm_mld_update_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
        for_each_sta_active_link(vif, sta, link_sta, link_id) {
                struct ieee80211_bss_conf *link_conf =
-                       rcu_dereference_protected(vif->link_conf[link_id], 1);
+                       link_conf_dereference_protected(vif, link_id);
                struct iwl_mvm_link_sta *mvm_link_sta =
                        rcu_dereference_protected(mvm_sta->link[link_id],
                                                  lockdep_is_held(&mvm->mutex));
@@ -983,9 +983,9 @@ int iwl_mvm_mld_update_sta_links(struct iwl_mvm *mvm,
 
        for_each_set_bit(link_id, &links_to_add, IEEE80211_MLD_MAX_NUM_LINKS) {
                struct ieee80211_bss_conf *link_conf =
-                       rcu_dereference_protected(vif->link_conf[link_id], 1);
+                       link_conf_dereference_protected(vif, link_id);
                struct ieee80211_link_sta *link_sta =
-                       rcu_dereference_protected(sta->link[link_id], 1);
+                       link_sta_dereference_protected(sta, link_id);
                mvm_vif_link = mvm_vif->link[link_id];
 
                if (WARN_ON(!mvm_vif_link || !link_conf || !link_sta ||