summaryrefslogtreecommitdiff
path: root/package/kernel/mac80211/patches/300-pending_work.patch
blob: d6d042d460b23a99a947cdb6f95114890e2f5eee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
commit c82552c5b0cb1735dbcbad78b1ffc6d3c212dc56
Author: Tim Harvey <tharvey@gateworks.com>
Date:   Mon Apr 21 16:14:57 2014 -0700

    ath9k: add a recv budget
    
    Implement a recv budget so that in cases of high traffic we still allow other
    taskets to get processed.
    
    Without this, we can encounter a host of issues during high wireless traffic
    reception depending on system load including rcu stall's detected (ARM),
    soft lockups, failure to service critical tasks such as watchdog resets,
    and triggering of the tx stuck tasklet.
    
    The same thing was proposed previously by Ben:
     http://www.spinics.net/lists/linux-wireless/msg112891.html
    
    The only difference here is that I make sure only processed packets are counted
    in the budget by checking at the end of the rx loop.
    
    Signed-off-by: Tim Harvey <tharvey@gateworks.com>
    Acked-by: Felix Fietkau <nbd@openwrt.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

commit 3a758134e66ca74a9df792616b5288b2fa2cfd7f
Author: Tim Harvey <tharvey@gateworks.com>
Date:   Mon Apr 21 16:14:56 2014 -0700

    ath9k: fix possible hang on flush
    
    If a flush is requested, make sure to clear the descriptor once we've
    processed it.
    
    This resolves a hang that will occur if all RX descriptors are full when a
    flush is requested.
    
    Signed-off-by: Tim Harvey <tharvey@gateworks.com>
    Acked-by: Felix Fietkau <nbd@openwrt.org>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

commit eefb1d6adc4c60d219182b8917e4567484ce07fc
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Mon Apr 28 18:27:41 2014 +0200

    ath9k: remove tid->paused flag
    
    There are some corner cases where the driver could get stuck with a full
    tid queue that is paused, leading to a software tx queue hang.
    
    Since the tx queueing rework, pausing per-tid queues on aggregation
    session setup is no longer necessary. The driver will assign sequence
    numbers to buffered frames when a new session is established, in order
    to get the correct starting sequence number.
    
    mac80211 prevents new frames from entering the queue during setup.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>

commit 98a713933d8495f4078f561c1e651b738dd5b531
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Sun Apr 27 14:49:03 2014 +0200

    ath9k_hw: do not lower ANI setting below default on AR913x
    
    When the amount of noise fluctuates strongly, low immunity settings
    can sometimes disrupt signal detection on AR913x chips. When that
    happens, no OFDM/CCK errors are reported anymore, and ANI tunes the
    radio to the lowest immunity settings.
    Usually rx/tx fails as well in that case.
    
    To fix this, keep noise immunity settings at or above ANI default level,
    which will keep radio parameters at or above INI values.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>

commit 7cbb4c021bfd1e656f5b9953a947ab3c64e4e3b0
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Thu Apr 10 10:49:01 2014 +0200

    mac80211: exclude AP_VLAN interfaces from tx power calculation
    
    Their power value is initialized to zero. This patch fixes an issue
    where the configured power drops to the minimum value when AP_VLAN
    interfaces are created/removed.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>

commit 0ca13e26341733bf9577287fb04a3bef0d2f5cc9
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Wed Apr 9 00:07:01 2014 +0200

    mac80211: suppress BSS info change notifications for AP_VLAN
    
    Fixes warnings on tx power changes
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>

commit ec998e5991781ecdaad0911dc64f1c8d3749c308
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Tue Apr 8 23:42:17 2014 +0200

    ath9k: fix a scheduling while atomic bug in CSA handling
    
    Commit "ath9k: prepare for multi-interface CSA support" added a call to
    ieee80211_iterate_active_interfaces in atomic context (beacon tasklet),
    which is crashing.
    Use ieee80211_iterate_active_interfaces_atomic instead.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>

commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
Author: Felix Fietkau <nbd@openwrt.org>
Date:   Sun Apr 6 23:35:28 2014 +0200

    ath9k_hw: reduce ANI firstep range for older chips
    
    Use 0-8 instead of 0-16, which is closer to the old implementation.
    Also drop the overwrite of the firstep_low parameter to improve
    stability.
    
    Signed-off-by: Felix Fietkau <nbd@openwrt.org>


--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
 	case ATH9K_ANI_FIRSTEP_LEVEL:{
 		u32 level = param;
 
-		value = level * 2;
+		value = level;
 		REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
 			      AR_PHY_FIND_SIG_FIRSTEP, value);
-		REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
-			      AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
 
 		if (level != aniState->firstepLevel) {
 			ath_dbg(common, ANI,
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *d
 
 void ath9k_csa_update(struct ath_softc *sc)
 {
-	ieee80211_iterate_active_interfaces(sc->hw,
-					    IEEE80211_IFACE_ITER_NORMAL,
-					    ath9k_csa_update_vif,
-					    sc);
+	ieee80211_iterate_active_interfaces_atomic(sc->hw,
+						   IEEE80211_IFACE_ITER_NORMAL,
+						   ath9k_csa_update_vif, sc);
 }
 
 void ath9k_beacon_tasklet(unsigned long data)
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -152,6 +152,8 @@ static u32 ieee80211_hw_conf_chan(struct
 	list_for_each_entry_rcu(sdata, &local->interfaces, list) {
 		if (!rcu_access_pointer(sdata->vif.chanctx_conf))
 			continue;
+		if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+			continue;
 		power = min(power, sdata->vif.bss_conf.txpower);
 	}
 	rcu_read_unlock();
@@ -203,7 +205,7 @@ void ieee80211_bss_info_change_notify(st
 {
 	struct ieee80211_local *local = sdata->local;
 
-	if (!changed)
+	if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
 		return;
 
 	drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct
 		ATH9K_ANI_RSSI_THR_LOW,
 		ATH9K_ANI_RSSI_THR_HIGH);
 
+	if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL)
+		immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
+
 	if (!scan)
 		aniState->ofdmNoiseImmunityLevel = immunityLevel;
 
@@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct 
 		BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW,
 		ATH9K_ANI_RSSI_THR_HIGH);
 
+	if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL)
+		immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
+
 	if (ah->opmode == NL80211_IFTYPE_STATION &&
 	    BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW &&
 	    immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -251,7 +251,6 @@ struct ath_atx_tid {
 
 	s8 bar_index;
 	bool sched;
-	bool paused;
 	bool active;
 };
 
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -107,9 +107,6 @@ static void ath_tx_queue_tid(struct ath_
 {
 	struct ath_atx_ac *ac = tid->ac;
 
-	if (tid->paused)
-		return;
-
 	if (tid->sched)
 		return;
 
@@ -1407,7 +1404,6 @@ int ath_tx_aggr_start(struct ath_softc *
 	ath_tx_tid_change_state(sc, txtid);
 
 	txtid->active = true;
-	txtid->paused = true;
 	*ssn = txtid->seq_start = txtid->seq_next;
 	txtid->bar_index = -1;
 
@@ -1427,7 +1423,6 @@ void ath_tx_aggr_stop(struct ath_softc *
 
 	ath_txq_lock(sc, txq);
 	txtid->active = false;
-	txtid->paused = false;
 	ath_tx_flush_tid(sc, txtid);
 	ath_tx_tid_change_state(sc, txtid);
 	ath_txq_unlock_complete(sc, txq);
@@ -1487,7 +1482,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
 		ath_txq_lock(sc, txq);
 		ac->clear_ps_filter = true;
 
-		if (!tid->paused && ath_tid_has_buffered(tid)) {
+		if (ath_tid_has_buffered(tid)) {
 			ath_tx_queue_tid(txq, tid);
 			ath_txq_schedule(sc, txq);
 		}
@@ -1510,7 +1505,6 @@ void ath_tx_aggr_resume(struct ath_softc
 	ath_txq_lock(sc, txq);
 
 	tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
-	tid->paused = false;
 
 	if (ath_tid_has_buffered(tid)) {
 		ath_tx_queue_tid(txq, tid);
@@ -1544,8 +1538,6 @@ void ath9k_release_buffered_frames(struc
 			continue;
 
 		tid = ATH_AN_2_TID(an, i);
-		if (tid->paused)
-			continue;
 
 		ath_txq_lock(sc, tid->ac->txq);
 		while (nframes > 0) {
@@ -1844,9 +1836,6 @@ void ath_txq_schedule(struct ath_softc *
 			list_del(&tid->list);
 			tid->sched = false;
 
-			if (tid->paused)
-				continue;
-
 			if (ath_tx_sched_aggr(sc, txq, tid, &stop))
 				sent = true;
 
@@ -2698,7 +2687,6 @@ void ath_tx_node_init(struct ath_softc *
 		tid->baw_size  = WME_MAX_BA;
 		tid->baw_head  = tid->baw_tail = 0;
 		tid->sched     = false;
-		tid->paused    = false;
 		tid->active	   = false;
 		__skb_queue_head_init(&tid->buf_q);
 		__skb_queue_head_init(&tid->retry_q);
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -975,6 +975,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
 	u64 tsf = 0;
 	unsigned long flags;
 	dma_addr_t new_buf_addr;
+	unsigned int budget = 512;
 
 	if (edma)
 		dma_type = DMA_BIDIRECTIONAL;
@@ -1113,15 +1114,17 @@ requeue_drop_frag:
 		}
 requeue:
 		list_add_tail(&bf->list, &sc->rx.rxbuf);
-		if (flush)
-			continue;
 
 		if (edma) {
 			ath_rx_edma_buf_link(sc, qtype);
 		} else {
 			ath_rx_buf_relink(sc, bf);
-			ath9k_hw_rxena(ah);
+			if (!flush)
+				ath9k_hw_rxena(ah);
 		}
+
+		if (!budget--)
+			break;
 	} while (1);
 
 	if (!(ah->imask & ATH9K_INT_RXEOL)) {