linux/net/mac80211
Johannes Berg 8147dc7f54 mac80211: fix aggregation state with current drivers
For drivers that don't actually flush their queues when
aggregation stop with the IEEE80211_AMPDU_TX_STOP_FLUSH
or IEEE80211_AMPDU_TX_STOP_FLUSH_CONT reasons is done,
like iwlwifi or iwlegacy, mac80211 can then transmit on
a TID that the driver still considers busy. This happens
in the following way:

 - IEEE80211_AMPDU_TX_STOP_FLUSH requested
 - driver marks TID as emptying
 - mac80211 removes tid_tx data, this can copy packets
   to the TX pending queues and also let new packets
   through to the driver
 - driver gets unexpected TX as it wasn't completely
   converted to the new API

In iwlwifi, this lead to the following warning:

WARNING: at drivers/net/wireless/iwlwifi/dvm/tx.c:442 iwlagn_tx_skb+0xc47/0xce0
Tx while agg.state = 4
Modules linked in: [...]
Pid: 0, comm: kworker/0:0 Tainted: G        W   3.1.0 #1
Call Trace:
 [<c1046e42>] warn_slowpath_common+0x72/0xa0
 [<c1046f13>] warn_slowpath_fmt+0x33/0x40
 [<fddffa17>] iwlagn_tx_skb+0xc47/0xce0 [iwldvm]
 [<fddfcaa3>] iwlagn_mac_tx+0x23/0x40 [iwldvm]
 [<fd8c98b6>] __ieee80211_tx+0xf6/0x3c0 [mac80211]
 [<fd8cbe00>] ieee80211_tx+0xd0/0x100 [mac80211]
 [<fd8cc176>] ieee80211_xmit+0x96/0xe0 [mac80211]
 [<fd8cc578>] ieee80211_subif_start_xmit+0x348/0xc80 [mac80211]
 [<c1445207>] dev_hard_start_xmit+0x337/0x6d0
 [<c145eee9>] sch_direct_xmit+0xa9/0x210
 [<c14462c0>] dev_queue_xmit+0x1b0/0x8e0

Fortunately, solving this problem is easy as the station
is being destroyed, so such transmit packets can only
happen due to races. Instead of trying to close the race
just let the race not reach the drivers by making two
changes:
 1) remove the explicit aggregation session teardown in
    the managed mode code, the same thing will be done
    when the station is removed, in __sta_info_destroy.
 2) When aggregation stop with AGG_STOP_DESTROY_STA is
    requested, leave the tid_tx data around as stopped.
    It will be cleared and freed in cleanup_single_sta
    later, but until then any racy packets will be put
    onto the tid_tx pending queue instead of transmitted
    which is fine since the station is being removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-24 15:43:51 +01:00
..
aes_ccm.c
aes_ccm.h
aes_cmac.c mac80211: include export.h in aes_cmac 2012-11-07 18:01:54 +01:00
aes_cmac.h
agg-rx.c mac80211: improve aggregation debug messages 2013-01-18 21:55:15 +01:00
agg-tx.c mac80211: fix aggregation state with current drivers 2013-01-24 15:43:51 +01:00
cfg.c {cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join 2013-01-16 22:44:04 +01:00
cfg.h
chan.c mac80211: fix channel context iteration 2013-01-03 13:01:35 +01:00
debug.h mac80211: trace debug messages 2012-06-24 11:33:18 +02:00
debugfs_key.c mac80211: add debug file for mic failure 2012-12-05 09:44:41 +01:00
debugfs_key.h
debugfs_netdev.c mac80211: convert to channel definition struct 2012-11-26 12:42:59 +01:00
debugfs_netdev.h
debugfs_sta.c net: remove obsolete simple_strto<foo> 2012-12-11 12:49:53 -05:00
debugfs_sta.h
debugfs.c mac80211: make reset debugfs depend on CONFIG_PM 2012-09-19 08:20:24 +02:00
debugfs.h mac80211: use __printf attribute in debugfs 2012-10-18 09:01:57 +02:00
driver-ops.h mac80211: provide the vif in rssi_callback 2013-01-24 15:41:29 +01:00
event.c
ht.c mac80211: unset peer's HT 40 MHz support if not usable 2013-01-03 13:01:45 +01:00
ibss.c mac80211: track enable_beacon explicitly 2013-01-03 13:01:35 +01:00
ieee80211_i.h mac80211: allow drivers to access IPv6 information 2013-01-18 21:55:38 +01:00
iface.c mac80211: remove ARP filter enable/disable logic 2013-01-18 21:20:34 +01:00
Kconfig mac80211: fix copy-paste typo in Kconfig 2012-10-18 09:10:28 +02:00
key.c mac80211: add op to configure default key id 2013-01-18 13:30:21 +01:00
key.h mac80211: add debug file for mic failure 2012-12-05 09:44:41 +01:00
led.c leds: Rename led_brightness_set() to led_set_brightness() 2012-07-24 07:52:34 +08:00
led.h
main.c mac80211: allow drivers to access IPv6 information 2013-01-18 21:55:38 +01:00
Makefile mac80211: VHT peer STA caps 2012-10-17 11:02:14 +02:00
mesh_hwmp.c mac80211: fix mesh_hwmp kerneldoc 2013-01-04 13:51:22 +01:00
mesh_pathtbl.c mac80211: clean up mpath_move_to_queue() 2012-08-20 13:25:05 +02:00
mesh_plink.c mac80211: update mesh peer link counter during userspace peering 2013-01-16 22:40:56 +01:00
mesh_sync.c mac80211: fix for mesh sync to indicate TBTT adjustment 2012-11-30 12:41:46 +01:00
mesh.c {cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join 2013-01-16 22:44:04 +01:00
mesh.h {cfg,nl,mac}80211: set beacon interval and DTIM period on mesh join 2013-01-16 22:44:04 +01:00
michael.c
michael.h
mlme.c mac80211: fix aggregation state with current drivers 2013-01-24 15:43:51 +01:00
offchannel.c mac80211: track enable_beacon explicitly 2013-01-03 13:01:35 +01:00
pm.c mac80211: split aggregation stop by reason 2013-01-03 13:01:41 +01:00
rate.c mac80211: convert to channel definition struct 2012-11-26 12:42:59 +01:00
rate.h mac80211: convert to channel definition struct 2012-11-26 12:42:59 +01:00
rc80211_minstrel_debugfs.c
rc80211_minstrel_ht_debugfs.c
rc80211_minstrel_ht.c mac80211: simplify loop in minstrel_ht 2012-11-30 13:45:38 +01:00
rc80211_minstrel_ht.h
rc80211_minstrel.c minstrel: update stats after processing status 2012-12-10 22:51:50 +01:00
rc80211_minstrel.h
rc80211_pid_algo.c
rc80211_pid_debugfs.c
rc80211_pid.h
rx.c mac80211: support HT notify channel width action 2013-01-03 13:01:44 +01:00
scan.c mac82011: use frame control to differentiate probe resp/beacon 2013-01-03 13:01:33 +01:00
spectmgmt.c
sta_info.c mac80211: split aggregation stop by reason 2013-01-03 13:01:41 +01:00
sta_info.h mac80211: split aggregation stop by reason 2013-01-03 13:01:41 +01:00
status.c Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-next 2012-12-11 16:04:03 -05:00
tkip.c mac80211: remove TKIP debug 2012-06-22 11:26:58 +02:00
tkip.h
trace.c mac80211: trace debug messages 2012-06-24 11:33:18 +02:00
trace.h mac80211: provide the vif in rssi_callback 2013-01-24 15:41:29 +01:00
tx.c mac80211: move add_tim to subfunction 2013-01-16 22:43:22 +01:00
util.c mac80211: call restart complete at wowlan resume time 2013-01-16 15:19:01 +01:00
vht.c mac80211: VHT peer STA caps 2012-10-17 11:02:14 +02:00
wep.c mac80211: fix network header location when adding encryption headers 2012-05-16 12:47:43 -04:00
wep.h
wme.c mac80211: refactor ieee80211_set_qos_hdr 2012-11-26 11:36:02 +01:00
wme.h mac80211: save wmm_acm per sdata 2012-06-20 17:35:22 +02:00
wpa.c mac80211: add debug file for mic failure 2012-12-05 09:44:41 +01:00
wpa.h