ath9k: merge a few upstream fixes
[openwrt/staging/chunkeey.git] / package / kernel / mac80211 / patches / 300-pending_work.patch
1 commit 4d76248013dbb1948429555208900a585b0f351d
2 Author: Janusz Dziedzic <janusz.dziedzic@tieto.com>
3 Date: Tue Apr 8 13:38:43 2014 +0200
4
5 ath9k: Enable DFS only when ATH9K_DFS_CERTIFIED
6
7 Add DFS interface combination only when
8 CONFIG_ATH9K_DFS_CERTIFIED is set. In other case
9 user can run CAC/beaconing without proper handling
10 of pulse events (without radar detection activated).
11
12 Reported-by: Cedric Voncken <cedric.voncken@acksys.fr>
13 Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
14 Signed-off-by: John W. Linville <linville@tuxdriver.com>
15
16 commit c83a4e5156a4b4dd22137d33a5625440982d6d37
17 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
18 Date: Mon Apr 28 21:17:08 2014 +0530
19
20 ath9k_hw: fix worse EVM for 11b rates
21
22 Adjust FIR filter co-efficients to improve EVM for 11b rates.
23
24 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
25 Signed-off-by: John W. Linville <linville@tuxdriver.com>
26
27 commit 8aab2c7a2f4a957e344db429dfb1190ae59ce8b5
28 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
29 Date: Mon Apr 28 21:17:07 2014 +0530
30
31 ath9k_hw: update ar9300 initvals
32
33 * rfsat gainchange hysteresis of rf_gain stuck with large
34 interference present.
35
36 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
37 Signed-off-by: John W. Linville <linville@tuxdriver.com>
38
39 commit 8c7ae357cc5b6bd037ad2d666e9f3789cf882925
40 Author: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
41 Date: Wed Apr 23 15:07:57 2014 +0530
42
43 ath9k: fix race in setting ATH_OP_INVALID
44
45 The commit "ath9k: move sc_flags to ath_common" moved setting
46 ATH_OP_INVALID flag below ieee80211_register_hw. This is causing
47 the flag never being cleared randomly as the drv_start is called
48 prior to setting flag. Fix this by setting the flag prior to
49 register_hw.
50
51 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
52 Signed-off-by: John W. Linville <linville@tuxdriver.com>
53
54 commit c82552c5b0cb1735dbcbad78b1ffc6d3c212dc56
55 Author: Tim Harvey <tharvey@gateworks.com>
56 Date: Mon Apr 21 16:14:57 2014 -0700
57
58 ath9k: add a recv budget
59
60 Implement a recv budget so that in cases of high traffic we still allow other
61 taskets to get processed.
62
63 Without this, we can encounter a host of issues during high wireless traffic
64 reception depending on system load including rcu stall's detected (ARM),
65 soft lockups, failure to service critical tasks such as watchdog resets,
66 and triggering of the tx stuck tasklet.
67
68 The same thing was proposed previously by Ben:
69 http://www.spinics.net/lists/linux-wireless/msg112891.html
70
71 The only difference here is that I make sure only processed packets are counted
72 in the budget by checking at the end of the rx loop.
73
74 Signed-off-by: Tim Harvey <tharvey@gateworks.com>
75 Acked-by: Felix Fietkau <nbd@openwrt.org>
76 Signed-off-by: John W. Linville <linville@tuxdriver.com>
77
78 commit 3a758134e66ca74a9df792616b5288b2fa2cfd7f
79 Author: Tim Harvey <tharvey@gateworks.com>
80 Date: Mon Apr 21 16:14:56 2014 -0700
81
82 ath9k: fix possible hang on flush
83
84 If a flush is requested, make sure to clear the descriptor once we've
85 processed it.
86
87 This resolves a hang that will occur if all RX descriptors are full when a
88 flush is requested.
89
90 Signed-off-by: Tim Harvey <tharvey@gateworks.com>
91 Acked-by: Felix Fietkau <nbd@openwrt.org>
92 Signed-off-by: John W. Linville <linville@tuxdriver.com>
93
94 commit eefb1d6adc4c60d219182b8917e4567484ce07fc
95 Author: Felix Fietkau <nbd@openwrt.org>
96 Date: Mon Apr 28 18:27:41 2014 +0200
97
98 ath9k: remove tid->paused flag
99
100 There are some corner cases where the driver could get stuck with a full
101 tid queue that is paused, leading to a software tx queue hang.
102
103 Since the tx queueing rework, pausing per-tid queues on aggregation
104 session setup is no longer necessary. The driver will assign sequence
105 numbers to buffered frames when a new session is established, in order
106 to get the correct starting sequence number.
107
108 mac80211 prevents new frames from entering the queue during setup.
109
110 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
111
112 commit 98a713933d8495f4078f561c1e651b738dd5b531
113 Author: Felix Fietkau <nbd@openwrt.org>
114 Date: Sun Apr 27 14:49:03 2014 +0200
115
116 ath9k_hw: do not lower ANI setting below default on AR913x
117
118 When the amount of noise fluctuates strongly, low immunity settings
119 can sometimes disrupt signal detection on AR913x chips. When that
120 happens, no OFDM/CCK errors are reported anymore, and ANI tunes the
121 radio to the lowest immunity settings.
122 Usually rx/tx fails as well in that case.
123
124 To fix this, keep noise immunity settings at or above ANI default level,
125 which will keep radio parameters at or above INI values.
126
127 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
128
129 commit 7cbb4c021bfd1e656f5b9953a947ab3c64e4e3b0
130 Author: Felix Fietkau <nbd@openwrt.org>
131 Date: Thu Apr 10 10:49:01 2014 +0200
132
133 mac80211: exclude AP_VLAN interfaces from tx power calculation
134
135 Their power value is initialized to zero. This patch fixes an issue
136 where the configured power drops to the minimum value when AP_VLAN
137 interfaces are created/removed.
138
139 Cc: stable@vger.kernel.org
140 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
141
142 commit 0ca13e26341733bf9577287fb04a3bef0d2f5cc9
143 Author: Felix Fietkau <nbd@openwrt.org>
144 Date: Wed Apr 9 00:07:01 2014 +0200
145
146 mac80211: suppress BSS info change notifications for AP_VLAN
147
148 Fixes warnings on tx power changes
149
150 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
151
152 commit ec998e5991781ecdaad0911dc64f1c8d3749c308
153 Author: Felix Fietkau <nbd@openwrt.org>
154 Date: Tue Apr 8 23:42:17 2014 +0200
155
156 ath9k: fix a scheduling while atomic bug in CSA handling
157
158 Commit "ath9k: prepare for multi-interface CSA support" added a call to
159 ieee80211_iterate_active_interfaces in atomic context (beacon tasklet),
160 which is crashing.
161 Use ieee80211_iterate_active_interfaces_atomic instead.
162
163 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
164
165 commit 93f310a38a1d81a4bc8fcd9bf29628bd721cf2ef
166 Author: Felix Fietkau <nbd@openwrt.org>
167 Date: Sun Apr 6 23:35:28 2014 +0200
168
169 ath9k_hw: reduce ANI firstep range for older chips
170
171 Use 0-8 instead of 0-16, which is closer to the old implementation.
172 Also drop the overwrite of the firstep_low parameter to improve
173 stability.
174
175 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
176
177
178 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
179 +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
180 @@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(st
181 case ATH9K_ANI_FIRSTEP_LEVEL:{
182 u32 level = param;
183
184 - value = level * 2;
185 + value = level;
186 REG_RMW_FIELD(ah, AR_PHY_FIND_SIG,
187 AR_PHY_FIND_SIG_FIRSTEP, value);
188 - REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW,
189 - AR_PHY_FIND_SIG_FIRSTEP_LOW, value);
190
191 if (level != aniState->firstepLevel) {
192 ath_dbg(common, ANI,
193 --- a/drivers/net/wireless/ath/ath9k/beacon.c
194 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
195 @@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *d
196
197 void ath9k_csa_update(struct ath_softc *sc)
198 {
199 - ieee80211_iterate_active_interfaces(sc->hw,
200 - IEEE80211_IFACE_ITER_NORMAL,
201 - ath9k_csa_update_vif,
202 - sc);
203 + ieee80211_iterate_active_interfaces_atomic(sc->hw,
204 + IEEE80211_IFACE_ITER_NORMAL,
205 + ath9k_csa_update_vif, sc);
206 }
207
208 void ath9k_beacon_tasklet(unsigned long data)
209 --- a/net/mac80211/main.c
210 +++ b/net/mac80211/main.c
211 @@ -152,6 +152,8 @@ static u32 ieee80211_hw_conf_chan(struct
212 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
213 if (!rcu_access_pointer(sdata->vif.chanctx_conf))
214 continue;
215 + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
216 + continue;
217 power = min(power, sdata->vif.bss_conf.txpower);
218 }
219 rcu_read_unlock();
220 @@ -203,7 +205,7 @@ void ieee80211_bss_info_change_notify(st
221 {
222 struct ieee80211_local *local = sdata->local;
223
224 - if (!changed)
225 + if (!changed || sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
226 return;
227
228 drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
229 --- a/drivers/net/wireless/ath/ath9k/ani.c
230 +++ b/drivers/net/wireless/ath/ath9k/ani.c
231 @@ -155,6 +155,9 @@ static void ath9k_hw_set_ofdm_nil(struct
232 ATH9K_ANI_RSSI_THR_LOW,
233 ATH9K_ANI_RSSI_THR_HIGH);
234
235 + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_OFDM_DEF_LEVEL)
236 + immunityLevel = ATH9K_ANI_OFDM_DEF_LEVEL;
237 +
238 if (!scan)
239 aniState->ofdmNoiseImmunityLevel = immunityLevel;
240
241 @@ -235,6 +238,9 @@ static void ath9k_hw_set_cck_nil(struct
242 BEACON_RSSI(ah), ATH9K_ANI_RSSI_THR_LOW,
243 ATH9K_ANI_RSSI_THR_HIGH);
244
245 + if (AR_SREV_9100(ah) && immunityLevel < ATH9K_ANI_CCK_DEF_LEVEL)
246 + immunityLevel = ATH9K_ANI_CCK_DEF_LEVEL;
247 +
248 if (ah->opmode == NL80211_IFTYPE_STATION &&
249 BEACON_RSSI(ah) <= ATH9K_ANI_RSSI_THR_LOW &&
250 immunityLevel > ATH9K_ANI_CCK_MAX_LEVEL_LOW_RSSI)
251 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
252 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
253 @@ -251,7 +251,6 @@ struct ath_atx_tid {
254
255 s8 bar_index;
256 bool sched;
257 - bool paused;
258 bool active;
259 };
260
261 --- a/drivers/net/wireless/ath/ath9k/xmit.c
262 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
263 @@ -107,9 +107,6 @@ static void ath_tx_queue_tid(struct ath_
264 {
265 struct ath_atx_ac *ac = tid->ac;
266
267 - if (tid->paused)
268 - return;
269 -
270 if (tid->sched)
271 return;
272
273 @@ -1407,7 +1404,6 @@ int ath_tx_aggr_start(struct ath_softc *
274 ath_tx_tid_change_state(sc, txtid);
275
276 txtid->active = true;
277 - txtid->paused = true;
278 *ssn = txtid->seq_start = txtid->seq_next;
279 txtid->bar_index = -1;
280
281 @@ -1427,7 +1423,6 @@ void ath_tx_aggr_stop(struct ath_softc *
282
283 ath_txq_lock(sc, txq);
284 txtid->active = false;
285 - txtid->paused = false;
286 ath_tx_flush_tid(sc, txtid);
287 ath_tx_tid_change_state(sc, txtid);
288 ath_txq_unlock_complete(sc, txq);
289 @@ -1487,7 +1482,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
290 ath_txq_lock(sc, txq);
291 ac->clear_ps_filter = true;
292
293 - if (!tid->paused && ath_tid_has_buffered(tid)) {
294 + if (ath_tid_has_buffered(tid)) {
295 ath_tx_queue_tid(txq, tid);
296 ath_txq_schedule(sc, txq);
297 }
298 @@ -1510,7 +1505,6 @@ void ath_tx_aggr_resume(struct ath_softc
299 ath_txq_lock(sc, txq);
300
301 tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
302 - tid->paused = false;
303
304 if (ath_tid_has_buffered(tid)) {
305 ath_tx_queue_tid(txq, tid);
306 @@ -1544,8 +1538,6 @@ void ath9k_release_buffered_frames(struc
307 continue;
308
309 tid = ATH_AN_2_TID(an, i);
310 - if (tid->paused)
311 - continue;
312
313 ath_txq_lock(sc, tid->ac->txq);
314 while (nframes > 0) {
315 @@ -1844,9 +1836,6 @@ void ath_txq_schedule(struct ath_softc *
316 list_del(&tid->list);
317 tid->sched = false;
318
319 - if (tid->paused)
320 - continue;
321 -
322 if (ath_tx_sched_aggr(sc, txq, tid, &stop))
323 sent = true;
324
325 @@ -2698,7 +2687,6 @@ void ath_tx_node_init(struct ath_softc *
326 tid->baw_size = WME_MAX_BA;
327 tid->baw_head = tid->baw_tail = 0;
328 tid->sched = false;
329 - tid->paused = false;
330 tid->active = false;
331 __skb_queue_head_init(&tid->buf_q);
332 __skb_queue_head_init(&tid->retry_q);
333 --- a/drivers/net/wireless/ath/ath9k/recv.c
334 +++ b/drivers/net/wireless/ath/ath9k/recv.c
335 @@ -975,6 +975,7 @@ int ath_rx_tasklet(struct ath_softc *sc,
336 u64 tsf = 0;
337 unsigned long flags;
338 dma_addr_t new_buf_addr;
339 + unsigned int budget = 512;
340
341 if (edma)
342 dma_type = DMA_BIDIRECTIONAL;
343 @@ -1113,15 +1114,17 @@ requeue_drop_frag:
344 }
345 requeue:
346 list_add_tail(&bf->list, &sc->rx.rxbuf);
347 - if (flush)
348 - continue;
349
350 if (edma) {
351 ath_rx_edma_buf_link(sc, qtype);
352 } else {
353 ath_rx_buf_relink(sc, bf);
354 - ath9k_hw_rxena(ah);
355 + if (!flush)
356 + ath9k_hw_rxena(ah);
357 }
358 +
359 + if (!budget--)
360 + break;
361 } while (1);
362
363 if (!(ah->imask & ATH9K_INT_RXEOL)) {
364 --- a/drivers/net/wireless/ath/ath9k/ahb.c
365 +++ b/drivers/net/wireless/ath/ath9k/ahb.c
366 @@ -86,7 +86,6 @@ static int ath_ahb_probe(struct platform
367 int irq;
368 int ret = 0;
369 struct ath_hw *ah;
370 - struct ath_common *common;
371 char hw_name[64];
372
373 if (!dev_get_platdata(&pdev->dev)) {
374 @@ -146,9 +145,6 @@ static int ath_ahb_probe(struct platform
375 wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
376 hw_name, (unsigned long)mem, irq);
377
378 - common = ath9k_hw_common(sc->sc_ah);
379 - /* Will be cleared in ath9k_start() */
380 - set_bit(ATH_OP_INVALID, &common->op_flags);
381 return 0;
382
383 err_irq:
384 --- a/drivers/net/wireless/ath/ath9k/init.c
385 +++ b/drivers/net/wireless/ath/ath9k/init.c
386 @@ -670,6 +670,7 @@ static const struct ieee80211_iface_comb
387 .num_different_channels = 1,
388 .beacon_int_infra_match = true,
389 },
390 +#ifdef CONFIG_ATH9K_DFS_CERTIFIED
391 {
392 .limits = if_dfs_limits,
393 .n_limits = ARRAY_SIZE(if_dfs_limits),
394 @@ -679,6 +680,7 @@ static const struct ieee80211_iface_comb
395 .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
396 BIT(NL80211_CHAN_WIDTH_20),
397 }
398 +#endif
399 };
400
401 static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
402 @@ -781,6 +783,9 @@ int ath9k_init_device(u16 devid, struct
403 common = ath9k_hw_common(ah);
404 ath9k_set_hw_capab(sc, hw);
405
406 + /* Will be cleared in ath9k_start() */
407 + set_bit(ATH_OP_INVALID, &common->op_flags);
408 +
409 /* Initialize regulatory */
410 error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
411 ath9k_reg_notifier);
412 --- a/drivers/net/wireless/ath/ath9k/pci.c
413 +++ b/drivers/net/wireless/ath/ath9k/pci.c
414 @@ -784,7 +784,6 @@ static int ath_pci_probe(struct pci_dev
415 {
416 struct ath_softc *sc;
417 struct ieee80211_hw *hw;
418 - struct ath_common *common;
419 u8 csz;
420 u32 val;
421 int ret = 0;
422 @@ -877,10 +876,6 @@ static int ath_pci_probe(struct pci_dev
423 wiphy_info(hw->wiphy, "%s mem=0x%lx, irq=%d\n",
424 hw_name, (unsigned long)sc->mem, pdev->irq);
425
426 - /* Will be cleared in ath9k_start() */
427 - common = ath9k_hw_common(sc->sc_ah);
428 - set_bit(ATH_OP_INVALID, &common->op_flags);
429 -
430 return 0;
431
432 err_init:
433 --- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
434 +++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
435 @@ -410,7 +410,7 @@ static const u32 ar9300_2p2_baseband_cor
436 {0x00009e30, 0x06336f77},
437 {0x00009e34, 0x6af6532f},
438 {0x00009e38, 0x0cc80c00},
439 - {0x00009e40, 0x0d261820},
440 + {0x00009e40, 0x0d261800},
441 {0x00009e4c, 0x00001004},
442 {0x00009e50, 0x00ff03f1},
443 {0x00009e54, 0x00000000},
444 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
445 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
446 @@ -592,7 +592,7 @@ static const u32 ar9331_1p1_baseband_cor
447 {0x00009e30, 0x06336f77},
448 {0x00009e34, 0x6af6532f},
449 {0x00009e38, 0x0cc80c00},
450 - {0x00009e40, 0x0d261820},
451 + {0x00009e40, 0x0d261800},
452 {0x00009e4c, 0x00001004},
453 {0x00009e50, 0x00ff03f1},
454 {0x00009fc0, 0x803e4788},
455 --- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
456 +++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
457 @@ -231,7 +231,7 @@ static const u32 ar9331_1p2_baseband_cor
458 {0x00009e30, 0x06336f77},
459 {0x00009e34, 0x6af6532f},
460 {0x00009e38, 0x0cc80c00},
461 - {0x00009e40, 0x0d261820},
462 + {0x00009e40, 0x0d261800},
463 {0x00009e4c, 0x00001004},
464 {0x00009e50, 0x00ff03f1},
465 {0x00009fc0, 0x803e4788},
466 --- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
467 +++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
468 @@ -318,7 +318,7 @@ static const u32 ar9340_1p0_baseband_cor
469 {0x00009e30, 0x06336f77},
470 {0x00009e34, 0x6af6532f},
471 {0x00009e38, 0x0cc80c00},
472 - {0x00009e40, 0x0d261820},
473 + {0x00009e40, 0x0d261800},
474 {0x00009e4c, 0x00001004},
475 {0x00009e50, 0x00ff03f1},
476 {0x00009e54, 0x00000000},
477 @@ -348,9 +348,9 @@ static const u32 ar9340_1p0_baseband_cor
478 {0x0000a370, 0x00000000},
479 {0x0000a390, 0x00000001},
480 {0x0000a394, 0x00000444},
481 - {0x0000a398, 0x00000000},
482 - {0x0000a39c, 0x210d0401},
483 - {0x0000a3a0, 0xab9a7144},
484 + {0x0000a398, 0x001f0e0f},
485 + {0x0000a39c, 0x0075393f},
486 + {0x0000a3a0, 0xb79f6427},
487 {0x0000a3a4, 0x00000000},
488 {0x0000a3a8, 0xaaaaaaaa},
489 {0x0000a3ac, 0x3c466478},
490 --- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
491 +++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
492 @@ -90,7 +90,7 @@ static const u32 ar9580_1p0_baseband_cor
493 {0x00009e30, 0x06336f77},
494 {0x00009e34, 0x6af6532f},
495 {0x00009e38, 0x0cc80c00},
496 - {0x00009e40, 0x0d261820},
497 + {0x00009e40, 0x0d261800},
498 {0x00009e4c, 0x00001004},
499 {0x00009e50, 0x00ff03f1},
500 {0x00009e54, 0x00000000},
501 --- a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
502 +++ b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
503 @@ -257,9 +257,9 @@ static const u32 qca953x_1p0_baseband_co
504 {0x0000a370, 0x00000000},
505 {0x0000a390, 0x00000001},
506 {0x0000a394, 0x00000444},
507 - {0x0000a398, 0x1f020503},
508 - {0x0000a39c, 0x29180c03},
509 - {0x0000a3a0, 0x9a8b6844},
510 + {0x0000a398, 0x001f0e0f},
511 + {0x0000a39c, 0x0075393f},
512 + {0x0000a3a0, 0xb79f6427},
513 {0x0000a3a4, 0x000000ff},
514 {0x0000a3a8, 0x6a6a6a6a},
515 {0x0000a3ac, 0x6a6a6a6a},