Search Linux Wireless

[PATCH 1/6] cfg80211: some workqueue improvements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rdev->rfkill_sync and rdev->sched_scan_results_wk works are canceled
when unregistering wiphy.

Reg_regdb_work is canceled in regulatory_exit(), if related config
option is enabled.

Queue cfg80211_disconnect_work to cfg80211_wq, since it's a work used
by cfg80211.

Change flush_work() to more robust cancel_work_sync().

Signed-off-by: Zhao, Gang <gamerh2o@xxxxxxxxx>
---
 net/wireless/core.c | 6 ++++--
 net/wireless/reg.c  | 4 ++++
 net/wireless/sme.c  | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/net/wireless/core.c b/net/wireless/core.c
index 276cf93..68a027c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -671,9 +671,11 @@ void wiphy_unregister(struct wiphy *wiphy)
 
 	rtnl_unlock();
 
-	flush_work(&rdev->scan_done_wk);
+	cancel_work_sync(&rdev->rfkill_sync);
+	cancel_work_sync(&rdev->scan_done_wk);
+	cancel_work_sync(&rdev->sched_scan_results_wk);
 	cancel_work_sync(&rdev->conn_work);
-	flush_work(&rdev->event_work);
+	cancel_work_sync(&rdev->event_work);
 	cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
 
 #ifdef CONFIG_PM
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f59aaac..12d3194 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2666,6 +2666,10 @@ void regulatory_exit(void)
 	cancel_work_sync(&reg_work);
 	cancel_delayed_work_sync(&reg_timeout);
 
+#ifdef CONFIG_CFG80211_INTERNAL_REGDB
+	cancel_work_sync(&reg_regdb_work);
+#endif
+
 	/* Lock to suppress warnings */
 	rtnl_lock();
 	reset_regdomains(true, NULL);
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index acdcb4a8..11b2779 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -873,7 +873,7 @@ void __cfg80211_disconnected(struct net_device *dev, const u8 *ie,
 	wdev->wext.connect.ssid_len = 0;
 #endif
 
-	schedule_work(&cfg80211_disconnect_work);
+	queue_work(cfg80211_wq, &cfg80211_disconnect_work);
 }
 
 void cfg80211_disconnected(struct net_device *dev, u16 reason,
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux