mac80211: synchronize_net() before flushing the queues
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 22 Jan 2015 21:30:19 +0000 (23:30 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 23 Jan 2015 09:54:21 +0000 (10:54 +0100)
When mac80211 disconnects, it drops all the packets on the
queues. This happens after the net stack has been notified
that we have no link anymore (netif_carrier_off).
netif_carrier_off ensures that no new packets are sent to
xmit() callback, but we might have older packets in the
middle of the Tx path. These packets will land in the
driver's queues after the latter have been flushed.
Synchronize_net() between netif_carrier_off and drv_flush()
will fix this.

Note that we can't call synchronize_net inside
ieee80211_flush_queues since there are flows that call
ieee80211_flush_queues and don't need synchronize_net()
which is an expensive operation.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[reword comment to be more accurate]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 1875181ebd9446923856fc5d5796a28b08a7864d..5cce6055f3ae1c7a483a7712e7c365db970534ee 100644 (file)
@@ -2011,6 +2011,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
        /* disable per-vif ps */
        ieee80211_recalc_ps_vif(sdata);
 
+       /* make sure ongoing transmission finishes */
+       synchronize_net();
+
        /*
         * drop any frame before deauth/disassoc, this can be data or
         * management frame. Since we are disconnecting, we should not
This page took 0.035813 seconds and 5 git commands to generate.