Skip to content

Commit 8ceb595

Browse files
bcopelandjmberg-intel
authored andcommitted
mac80211: use synchronize_rcu() with rcu_barrier()
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>
1 parent 908f8d0 commit 8ceb595

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎net/mac80211/cfg.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
10431043
list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
10441044
sta_info_flush_defer(vlan);
10451045
sta_info_flush_defer(sdata);
1046+
synchronize_net();
10461047
rcu_barrier();
10471048
list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) {
10481049
sta_info_flush_cleanup(vlan);

‎net/mac80211/iface.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
839839
*
840840
* sta_info_flush_cleanup() requires rcu_barrier()
841841
* first to wait for the station call_rcu() calls
842-
* to complete, here we need at least sychronize_rcu()
843-
* it to wait for the RX path in case it is using the
842+
* to complete, and we also need synchronize_rcu()
843+
* to wait for the RX path in case it is using the
844844
* interface and enqueuing frames at this very time on
845845
* another CPU.
846846
*/
847+
synchronize_rcu();
847848
rcu_barrier();
848849
sta_info_flush_cleanup(sdata);
849850

‎net/mac80211/pm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
3838
IEEE80211_QUEUE_STOP_REASON_SUSPEND);
3939

4040
/* flush out all packets and station cleanup call_rcu()s */
41+
synchronize_net();
4142
rcu_barrier();
4243

4344
ieee80211_flush_queues(local, NULL);

0 commit comments

Comments
 (0)