wifi: mac80211: move link activation work to wiphy work
authorJohannes Berg <johannes.berg@intel.com>
Mon, 28 Aug 2023 11:59:43 +0000 (13:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 11 Sep 2023 09:27:20 +0000 (11:27 +0200)
We want to have the wiphy locked for these as well,
so move it to be a wiphy work.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ieee80211_i.h
net/mac80211/iface.c
net/mac80211/link.c

index 6d789087b453de02c324aab913de8ad1c9416cc1..3db1accb0903c08455f0e32e2873d7b31fd59aae 100644 (file)
@@ -1112,7 +1112,7 @@ struct ieee80211_sub_if_data {
        struct ieee80211_link_data __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
 
        /* for ieee80211_set_active_links_async() */
-       struct work_struct activate_links_work;
+       struct wiphy_work activate_links_work;
        u16 desired_active_links;
 
 #ifdef CONFIG_MAC80211_DEBUGFS
index c0539e78a34e6ff705934c7d13277835db0b1f63..fa4514642d7469c1f4cf7bfafeb99c78b53623cf 100644 (file)
@@ -749,9 +749,9 @@ static int ieee80211_stop(struct net_device *dev)
                ieee80211_stop_mbssid(sdata);
        }
 
-       cancel_work_sync(&sdata->activate_links_work);
-
        wiphy_lock(sdata->local->hw.wiphy);
+       wiphy_work_cancel(sdata->local->hw.wiphy, &sdata->activate_links_work);
+
        ieee80211_do_stop(sdata, true);
        wiphy_unlock(sdata->local->hw.wiphy);
 
@@ -1691,7 +1691,8 @@ static void ieee80211_iface_work(struct wiphy *wiphy, struct wiphy_work *work)
        }
 }
 
-static void ieee80211_activate_links_work(struct work_struct *work)
+static void ieee80211_activate_links_work(struct wiphy *wiphy,
+                                         struct wiphy_work *work)
 {
        struct ieee80211_sub_if_data *sdata =
                container_of(work, struct ieee80211_sub_if_data,
@@ -1736,7 +1737,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
        skb_queue_head_init(&sdata->skb_queue);
        skb_queue_head_init(&sdata->status_queue);
        wiphy_work_init(&sdata->work, ieee80211_iface_work);
-       INIT_WORK(&sdata->activate_links_work, ieee80211_activate_links_work);
+       wiphy_work_init(&sdata->activate_links_work,
+                       ieee80211_activate_links_work);
 
        switch (type) {
        case NL80211_IFTYPE_P2P_GO:
index 748d222e8d3dd8b25aa76cba39c5cddefae2375b..bcff8a90940574822ecbb0076bc7071b35303197 100644 (file)
@@ -512,6 +512,6 @@ void ieee80211_set_active_links_async(struct ieee80211_vif *vif,
                return;
 
        sdata->desired_active_links = active_links;
-       schedule_work(&sdata->activate_links_work);
+       wiphy_work_queue(sdata->local->hw.wiphy, &sdata->activate_links_work);
 }
 EXPORT_SYMBOL_GPL(ieee80211_set_active_links_async);