mac80211: update to 2014-10-08
[openwrt/svn-archive/archive.git] / package / kernel / mac80211 / patches / 325-ath9k-Do-not-start-BA-when-scanning.patch
1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:30 +0530
3 Subject: [PATCH] ath9k: Do not start BA when scanning
4
5 mac80211 currently has a race which can be hit
6 with this sequence:
7
8 * Start a scan operation.
9 * TX BA is initiated by ieee80211_start_tx_ba_session().
10 * Driver sets up internal state and calls
11 ieee80211_start_tx_ba_cb_irqsafe().
12 * mac80211 adds a packet to sdata->skb_queue with
13 type IEEE80211_SDATA_QUEUE_AGG_START.
14 * ieee80211_iface_work() doesn't process the
15 packet because scan is in progress.
16 * ADDBA response timer expires and the sta/tid is
17 torn down.
18 * Driver receives BA stop notification and calls
19 ieee80211_stop_tx_ba_cb_irqsafe().
20 * This is also added to the queue by mac80211.
21 * Now, scan finishes.
22
23 At this point, the queued up packets might be processed
24 if some other operation schedules the sdata work. Since
25 the tids have been cleaned up already, warnings are hit.
26
27 If this doesn't happen, the packets are left in the queue
28 until the interface is torn down.
29
30 Since initiating a BA session when scan is in progress
31 leads to flaky connections, especially in MCC mode, we
32 can drop the TX BA request. This improves connectivity
33 with legacy clients in MCC mode.
34
35 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
36 ---
37
38 --- a/drivers/net/wireless/ath/ath9k/main.c
39 +++ b/drivers/net/wireless/ath/ath9k/main.c
40 @@ -1885,6 +1885,7 @@ static int ath9k_ampdu_action(struct iee
41 u16 tid, u16 *ssn, u8 buf_size)
42 {
43 struct ath_softc *sc = hw->priv;
44 + struct ath_common *common = ath9k_hw_common(sc->sc_ah);
45 bool flush = false;
46 int ret = 0;
47
48 @@ -1896,6 +1897,12 @@ static int ath9k_ampdu_action(struct iee
49 case IEEE80211_AMPDU_RX_STOP:
50 break;
51 case IEEE80211_AMPDU_TX_START:
52 + if (ath9k_is_chanctx_enabled()) {
53 + if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
54 + ret = -EBUSY;
55 + break;
56 + }
57 + }
58 ath9k_ps_wakeup(sc);
59 ret = ath_tx_aggr_start(sc, sta, tid, ssn);
60 if (!ret)