aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-07-04 07:41:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-08 14:16:04 -0400
commit8e260c22238dd8b57aefb1f5e4bd114486a9c17d (patch)
treeaaf7e9d32e1e30fa204d154e02f7dd9d45043319 /drivers
parentff352391acfac1e183c8c8b2858f9393bd064a65 (diff)
rt2x00: Use ieee80211_hw->workqueue again
Remove the rt2x00 singlethreaded workqueue and move the link tuner and packet filter scheduled work to the ieee80211_hw->workqueue again. The only exception is the interface scheduled work handler which uses the mac80211 interface iterator under the RTNL lock. This work needs to be handled on the kernel workqueue to prevent lockdep issues. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c17
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c4
3 files changed, 8 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 1b28dad7f204..c07d9ef383f0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -787,8 +787,10 @@ struct rt2x00_dev {
787 787
788 /* 788 /*
789 * Scheduled work. 789 * Scheduled work.
790 * NOTE: intf_work will use ieee80211_iterate_active_interfaces()
791 * which means it cannot be placed on the hw->workqueue
792 * due to RTNL locking requirements.
790 */ 793 */
791 struct workqueue_struct *workqueue;
792 struct work_struct intf_work; 794 struct work_struct intf_work;
793 struct work_struct filter_work; 795 struct work_struct filter_work;
794 796
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 41b3289b8281..8086263e5fa5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -74,7 +74,7 @@ static void rt2x00lib_start_link_tuner(struct rt2x00_dev *rt2x00dev)
74 74
75 rt2x00lib_reset_link_tuner(rt2x00dev); 75 rt2x00lib_reset_link_tuner(rt2x00dev);
76 76
77 queue_delayed_work(rt2x00dev->workqueue, 77 queue_delayed_work(rt2x00dev->hw->workqueue,
78 &rt2x00dev->link.work, LINK_TUNE_INTERVAL); 78 &rt2x00dev->link.work, LINK_TUNE_INTERVAL);
79} 79}
80 80
@@ -392,7 +392,7 @@ static void rt2x00lib_link_tuner(struct work_struct *work)
392 * Increase tuner counter, and reschedule the next link tuner run. 392 * Increase tuner counter, and reschedule the next link tuner run.
393 */ 393 */
394 rt2x00dev->link.count++; 394 rt2x00dev->link.count++;
395 queue_delayed_work(rt2x00dev->workqueue, 395 queue_delayed_work(rt2x00dev->hw->workqueue,
396 &rt2x00dev->link.work, LINK_TUNE_INTERVAL); 396 &rt2x00dev->link.work, LINK_TUNE_INTERVAL);
397} 397}
398 398
@@ -496,7 +496,7 @@ void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev)
496 rt2x00lib_beacondone_iter, 496 rt2x00lib_beacondone_iter,
497 rt2x00dev); 497 rt2x00dev);
498 498
499 queue_work(rt2x00dev->workqueue, &rt2x00dev->intf_work); 499 schedule_work(&rt2x00dev->intf_work);
500} 500}
501EXPORT_SYMBOL_GPL(rt2x00lib_beacondone); 501EXPORT_SYMBOL_GPL(rt2x00lib_beacondone);
502 502
@@ -1064,10 +1064,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
1064 /* 1064 /*
1065 * Initialize configuration work. 1065 * Initialize configuration work.
1066 */ 1066 */
1067 rt2x00dev->workqueue = create_singlethread_workqueue("rt2x00lib");
1068 if (!rt2x00dev->workqueue)
1069 goto exit;
1070
1071 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); 1067 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
1072 INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled); 1068 INIT_WORK(&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled);
1073 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner); 1069 INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00lib_link_tuner);
@@ -1128,13 +1124,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
1128 rt2x00leds_unregister(rt2x00dev); 1124 rt2x00leds_unregister(rt2x00dev);
1129 1125
1130 /* 1126 /*
1131 * Stop all queued work. Note that most tasks will already be halted
1132 * during rt2x00lib_disable_radio() and rt2x00lib_uninitialize().
1133 */
1134 flush_workqueue(rt2x00dev->workqueue);
1135 destroy_workqueue(rt2x00dev->workqueue);
1136
1137 /*
1138 * Free ieee80211_hw memory. 1127 * Free ieee80211_hw memory.
1139 */ 1128 */
1140 rt2x00lib_remove_hw(rt2x00dev); 1129 rt2x00lib_remove_hw(rt2x00dev);
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 1253da89295b..3a1fb6d47e5d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -431,7 +431,7 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
431 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags)) 431 if (!test_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags))
432 rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags); 432 rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags);
433 else 433 else
434 queue_work(rt2x00dev->workqueue, &rt2x00dev->filter_work); 434 queue_work(rt2x00dev->hw->workqueue, &rt2x00dev->filter_work);
435} 435}
436EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter); 436EXPORT_SYMBOL_GPL(rt2x00mac_configure_filter);
437 437
@@ -512,7 +512,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
512 memcpy(&intf->conf, bss_conf, sizeof(*bss_conf)); 512 memcpy(&intf->conf, bss_conf, sizeof(*bss_conf));
513 if (delayed) { 513 if (delayed) {
514 intf->delayed_flags |= delayed; 514 intf->delayed_flags |= delayed;
515 queue_work(rt2x00dev->workqueue, &rt2x00dev->intf_work); 515 schedule_work(&rt2x00dev->intf_work);
516 } 516 }
517 spin_unlock(&intf->lock); 517 spin_unlock(&intf->lock);
518} 518}