mac80211: use synchronize_rcu() with rcu_barrier()
authorBob Copeland <me@bobcopeland.com>
Thu, 18 Apr 2013 22:26:49 +0000 (18:26 -0400)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 22 Apr 2013 13:40:39 +0000 (15:40 +0200)
The RCU docs used to state that rcu_barrier() included a wait
for an RCU grace period; however the comments for rcu_barrier()
as of commit f0a0e6f... "rcu: Clarify memory-ordering properties
of grace-period primitives" contradict this.

So add back synchronize_{rcu,net}() to where they once were,
but keep the rcu_barrier()s for the call_rcu() callbacks.

Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bob Copeland <bob@cozybit.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/iface.c
net/mac80211/pm.c

index 490990e3fc3888cb370848b0feb7580fca40c0c3..1a89c80e6407ff6f487b3d7bf11e553e0e30e229 100644 (file)
@@ -1043,6 +1043,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
        list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
                sta_info_flush_defer(vlan);
        sta_info_flush_defer(sdata);
+       synchronize_net();
        rcu_barrier();
        list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) {
                sta_info_flush_cleanup(vlan);
index 146b1320af4e5946a27b17d7bb6ddb557ed62b12..9daa64ee337ec75c1a7307dc459073d0f123d10b 100644 (file)
@@ -839,11 +839,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
                 *
                 * sta_info_flush_cleanup() requires rcu_barrier()
                 * first to wait for the station call_rcu() calls
-                * to complete, here we need at least sychronize_rcu()
-                * it to wait for the RX path in case it is using the
+                * to complete, and we also need synchronize_rcu()
+                * to wait for the RX path in case it is using the
                 * interface and enqueuing frames at this very time on
                 * another CPU.
                 */
+               synchronize_rcu();
                rcu_barrier();
                sta_info_flush_cleanup(sdata);
 
index 4431f0ffe1577ea02e14597fd8fb191b00c31489..7fc5d0d8149a53f2a20377499841657dd9a97c7c 100644 (file)
@@ -38,6 +38,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
                                        IEEE80211_QUEUE_STOP_REASON_SUSPEND);
 
        /* flush out all packets and station cleanup call_rcu()s */
+       synchronize_net();
        rcu_barrier();
 
        ieee80211_flush_queues(local, NULL);