summaryrefslogtreecommitdiff
path: root/package/madwifi/patches/343-txqueue_races.patch
blob: afbf115c04098913c982ec22b72f949815a2d72b (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
Merged from madwifi trunk r3551, r3552

Index: madwifi-trunk-r3314/ath/if_ath.c
===================================================================
--- madwifi-trunk-r3314.orig/ath/if_ath.c
+++ madwifi-trunk-r3314/ath/if_ath.c
@@ -8244,6 +8244,17 @@
 			goto bf_fail;
 		}
 
+		/* We make sure we don't remove the TX descriptor on
+		 * which the HW is pointing since it contains the
+		 * ds_link field, except if this is the last TX
+		 * descriptor in the queue */
+
+		if ((txq->axq_depth > 1) &&
+		    (bf->bf_daddr == ath_hal_gettxbuf(ah, txq->axq_qnum))) {
+			ATH_TXQ_UNLOCK_IRQ_EARLY(txq);
+			goto bf_fail;
+		}
+
 		ATH_TXQ_REMOVE_HEAD(txq, bf_list);
 		ATH_TXQ_UNLOCK_IRQ(txq);
 
Index: madwifi-trunk-r3314/ath/if_athvar.h
===================================================================
--- madwifi-trunk-r3314.orig/ath/if_athvar.h
+++ madwifi-trunk-r3314/ath/if_athvar.h
@@ -586,7 +586,8 @@
 } while (0)
 #define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \
 	STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \
-	(_tq)->axq_depth--; \
+	if (--(_tq)->axq_depth <= 0) \
+		(_tq)->axq_link = NULL; \
 } while (0)
 /* move buffers from MCASTQ to CABQ */
 #define ATH_TXQ_MOVE_MCASTQ(_tqs,_tqd) do { \