]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mac80211: use synchronize_rcu() with rcu_barrier()
authorBob Copeland <me@bobcopeland.com>
Thu, 18 Apr 2013 22:26:49 +0000 (18:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2013 03:33:05 +0000 (20:33 -0700)
commit 8ceb59557bdc373e532b87d4142ce27e04218f0e upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/mac80211/cfg.c
net/mac80211/iface.c
net/mac80211/pm.c

index a6893602f87a753ebafeae0d0b8f449bdc7251f7..843d8c492d47cd15a698417b2b2dd4dd304aa6c7 100644 (file)
@@ -1034,6 +1034,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 9ed49ad0380f151fc5ad5448e953f6497d800291..d51ca9db9b4ce1f75b5e756945a85fd0fc42a2c2 100644 (file)
@@ -844,11 +844,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 a2f4655c1889c4038481321106f0fc944f9a8783..835584ca99258c87dd7edb7e6dfd2a510dc87ad4 100644 (file)
@@ -54,6 +54,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();
 
        drv_flush(local, false);