rt2x00: configure_filter() callback is allowed to sleep
PATCH 1/1 rt2x00: configure_filter() callback is allowed to sleep
The configure_filter() callback function no longer needs to be atomic. Remove the scheduled work structure and call into the driver configure_filter() directly.
--- drivers/net/wireless/rt2x00/rt2x00.h | 1 - drivers/net/wireless/rt2x00/rt2x00dev.c | 10 ---------- drivers/net/wireless/rt2x00/rt2x00mac.c | 5 +---- 3 files changed, 1 insertions(+), 15 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +0 -1
@@ -826,7 +826,6 @@ struct rt2x00_dev {* due to RTNL locking requirements. */ struct work_struct intf_work; -struct work_struct filter_work;/* * Data queue arrays for RX, TX and Beacon.
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -10
@@ -118,14 +118,6 @@ void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state)rt2x00link_start_tuner (rt2x00dev); } -static void rt2x00lib_packetfilter_scheduled (struct work_struct *work) -{ -struct rt2x00_dev *rt2x00dev = - container_of(work, struct rt2x00_dev, filter_work); - - rt2x00dev->ops->lib->config_filter (rt2x00dev, rt2x00dev->packet_filter); -} -static void rt2x00lib_intf_scheduled_iter (void *data,u8 *mac,struct ieee80211_vif *vif) {
@@ -859,7 +851,6 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)* Initialize configuration work. */ INIT_WORK (&rt2x00dev->intf_work, rt2x00lib_intf_scheduled); -INIT_WORK (&rt2x00dev->filter_work, rt2x00lib_packetfilter_scheduled);/* * Allocate queue array.
@@ -907,7 +898,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)/* * Stop all work. */ -cancel_work_sync (&rt2x00dev->filter_work);cancel_work_sync (&rt2x00dev->intf_work);/*
drivers/net/wireless/rt2x00/rt2x00mac.c +1 -4
@@ -430,10 +430,7 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,return ; rt2x00dev->packet_filter = *total_flags; -if (!test_bit (DRIVER_REQUIRE_SCHEDULED , &rt2x00dev->flags)) - rt2x00dev->ops->lib->config_filter (rt2x00dev, *total_flags); -else -ieee80211_queue_work (rt2x00dev->hw, &rt2x00dev->filter_work); + rt2x00dev->ops->lib->config_filter (rt2x00dev, *total_flags); }EXPORT_SYMBOL_GPL (rt2x00mac_configure_filter);
Signature · 1 line
1.6.4
Johannes Berg
maintainerQuoted 3 lines · Ivo van Doorn
The
configure_filter()callback function no longer needs to be atomic. Remove the scheduled work structure and call into the driverconfigure_filter()directly.
Nice, yeah, I didn't want to do that myself :)
Speaking of which -- bss_info_changed can sleep too, which means you can remove DRIVER_REQUIRE_SCHEDULED completely I think?
johannes
Quoted 9 lines · Johannes Berg
Quoted 3 lines · Ivo van Doorn
The
configure_filter()callback function no longer needs to be atomic. Remove the scheduled work structure and call into the driverconfigure_filter()directly.Nice, yeah, I didn't want to do that myself :)
Speaking of which --
bss_info_changedcan sleep too, which means you can removeDRIVER_REQUIRE_SCHEDULEDcompletely I think?
Seriously, that would be great. Patch coming up in a few minutes. ;)
Ivo
Johannes Berg
maintainerQuoted 4 lines · Ivo van Doorn
Quoted 2 lines
Speaking of which --
bss_info_changedcan sleep too, which means you can removeDRIVER_REQUIRE_SCHEDULEDcompletely I think?Seriously, that would be great. Patch coming up in a few minutes. ;)
Cool.
Hey, sorry it took so long to make it possible :)
I wonder if drivers now ever have a reason to queue work on the mac80211 workqueue? Some periodic calibration tasks maybe?
johannes
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Ivo van Doorn
Quoted 2 lines
Speaking of which --
bss_info_changedcan sleep too, which means you can removeDRIVER_REQUIRE_SCHEDULEDcompletely I think?
Quoted 8 lines
Quoted 1 line
Seriously, that would be great. Patch coming up in a few minutes. ;)
Cool.
Hey, sorry it took so long to make it possible :)
I wonder if drivers now ever have a reason to queue work on the mac80211 workqueue? Some periodic calibration tasks maybe?
Well after the removal of DRIVER_REQUIRE_SCHEDULED I only have 1 workqueue structure left: Updating beacons.
During the update it needs to iterate through all interfaces using ieee80211_iterate_active_interfaces_atomic(), during the actual update a mutex is required because USB device access is required. And not in the least the function is called by the set_tim() callback function.
Ivo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Ivo van Doorn
Quoted 2 lines
Speaking of which --
bss_info_changedcan sleep too, which means you can removeDRIVER_REQUIRE_SCHEDULEDcompletely I think?
Quoted 8 lines
Quoted 1 line
Seriously, that would be great. Patch coming up in a few minutes. ;)
Cool.
Hey, sorry it took so long to make it possible :)
I wonder if drivers now ever have a reason to queue work on the mac80211 workqueue? Some periodic calibration tasks maybe?
ath9k just has the virtual wiphy stuff and that uses the mac80211 workqueue. Maybe we can review this stuff at the summit in consideration for how we may want this eventually on mac80211/cfg80211.
Luis
Quoted 2 lines · Johannes Berg
I wonder if drivers now ever have a reason to queue work on the mac80211 workqueue? Some periodic calibration tasks maybe?
wl1251 and wl1271 queue tx frames to a workqueue. This is because they use synchronous spi interface. This might change if we switch asynchronous interface in the future. No idea how this affects sdio, though.
Signature · 1 line
Kalle Valo