From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 13/14] wifi: cfg80211: move sched scan stop to wiphy work
Date: Tue, 6 Jun 2023 14:49:32 +0200 [thread overview]
Message-ID: <20230606144753.a7da451559cf.I25ad10960aeffdfab348f9e6590048bed6d64933@changeid> (raw)
In-Reply-To: <20230606124933.181107-1-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
This work can now trivially be converted, it behaves
identical either way.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/core.c | 6 +++---
net/wireless/core.h | 2 +-
net/wireless/nl80211.c | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3b37bbc4e8d2..56b7d4404eed 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -365,7 +365,8 @@ static void cfg80211_destroy_iface_wk(struct work_struct *work)
rtnl_unlock();
}
-static void cfg80211_sched_scan_stop_wk(struct work_struct *work)
+static void cfg80211_sched_scan_stop_wk(struct wiphy *wiphy,
+ struct wiphy_work *work)
{
struct cfg80211_registered_device *rdev;
struct cfg80211_sched_scan_request *req, *tmp;
@@ -541,7 +542,7 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
device_enable_async_suspend(&rdev->wiphy.dev);
INIT_WORK(&rdev->destroy_work, cfg80211_destroy_iface_wk);
- INIT_WORK(&rdev->sched_scan_stop_wk, cfg80211_sched_scan_stop_wk);
+ wiphy_work_init(&rdev->sched_scan_stop_wk, cfg80211_sched_scan_stop_wk);
INIT_WORK(&rdev->sched_scan_res_wk, cfg80211_sched_scan_results_wk);
INIT_WORK(&rdev->propagate_radar_detect_wk,
cfg80211_propagate_radar_detect_wk);
@@ -1148,7 +1149,6 @@ void wiphy_unregister(struct wiphy *wiphy)
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
cancel_delayed_work_sync(&rdev->background_cac_done_wk);
flush_work(&rdev->destroy_work);
- flush_work(&rdev->sched_scan_stop_wk);
flush_work(&rdev->propagate_radar_detect_wk);
flush_work(&rdev->propagate_cac_done_wk);
flush_work(&rdev->mgmt_registrations_update_wk);
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 435060dad81e..468957a0be24 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -95,7 +95,7 @@ struct cfg80211_registered_device {
struct cfg80211_coalesce *coalesce;
struct work_struct destroy_work;
- struct work_struct sched_scan_stop_wk;
+ struct wiphy_work sched_scan_stop_wk;
struct work_struct sched_scan_res_wk;
struct cfg80211_chan_def radar_chandef;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b74092efa6f0..87a3551a2381 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -19775,7 +19775,8 @@ static int nl80211_netlink_notify(struct notifier_block * nb,
list) {
if (sched_scan_req->owner_nlportid == notify->portid) {
sched_scan_req->nl_owner_dead = true;
- schedule_work(&rdev->sched_scan_stop_wk);
+ wiphy_work_queue(&rdev->wiphy,
+ &rdev->sched_scan_stop_wk);
}
}
--
2.40.1
next prev parent reply other threads:[~2023-06-06 12:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 12:49 [PATCH 00/14] wifi: work cleanups part 1 Johannes Berg
2023-06-06 12:49 ` [PATCH 01/14] wifi: cfg80211: hold wiphy lock in auto-disconnect Johannes Berg
2023-06-06 12:49 ` [PATCH 02/14] wifi: cfg80211: hold wiphy lock in pmsr work Johannes Berg
2023-06-06 12:49 ` [PATCH 03/14] wifi: cfg80211: move wowlan disable under locks Johannes Berg
2023-06-06 12:49 ` [PATCH 04/14] wifi: cfg80211: wext: hold wiphy lock in siwgenie Johannes Berg
2023-06-06 12:49 ` [PATCH 05/14] wifi: cfg80211: hold wiphy lock when sending wiphy Johannes Berg
2023-06-06 12:49 ` [PATCH 06/14] wifi: cfg80211: add a work abstraction with special semantics Johannes Berg
2023-06-06 12:49 ` [PATCH 07/14] wifi: mac80211: use wiphy work for sdata->work Johannes Berg
2023-06-06 12:49 ` [PATCH 08/14] wifi: mac80211: unregister netdevs through cfg80211 Johannes Berg
2023-06-06 12:49 ` [PATCH 09/14] wifi: mac80211: use wiphy work for SMPS Johannes Berg
2023-06-06 12:49 ` [PATCH 10/14] wifi: mac80211: use wiphy work for channel switch Johannes Berg
2023-06-06 12:49 ` [PATCH 11/14] wifi: mac80211: ibss: move disconnect to wiphy work Johannes Berg
2023-06-06 12:49 ` [PATCH 12/14] wifi: mac80211: mlme: move disconnects " Johannes Berg
2023-06-06 12:49 ` Johannes Berg [this message]
2023-06-06 13:08 ` [PATCH 13/14] wifi: cfg80211: move sched scan stop " Johannes Berg
2023-06-06 12:49 ` [PATCH 14/14] wifi: cfg80211: move scan done work " Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230606144753.a7da451559cf.I25ad10960aeffdfab348f9e6590048bed6d64933@changeid \
--to=johannes@sipsolutions.net \
--cc=johannes.berg@intel.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).