1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -1221,49 +1221,59 @@ void ath_tx_cleanupq(struct ath_softc *s
4 sc->tx.txqsetup &= ~(1<<txq->axq_qnum);
7 +/* For each axq_acq entry, for each tid, try to schedule packets
8 + * for transmit until ampdu_depth has reached min Q depth.
10 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq)
12 - struct ath_atx_ac *ac;
13 - struct ath_atx_tid *tid, *last;
14 + struct ath_atx_ac *ac, *ac_tmp, *last_ac;
15 + struct ath_atx_tid *tid, *last_tid;
17 if (list_empty(&txq->axq_acq) ||
18 txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
21 ac = list_first_entry(&txq->axq_acq, struct ath_atx_ac, list);
22 - last = list_entry(ac->tid_q.prev, struct ath_atx_tid, list);
23 - list_del(&ac->list);
25 + last_ac = list_entry(txq->axq_acq.prev, struct ath_atx_ac, list);
28 - if (list_empty(&ac->tid_q))
31 - tid = list_first_entry(&ac->tid_q, struct ath_atx_tid, list);
32 - list_del(&tid->list);
34 + list_for_each_entry_safe(ac, ac_tmp, &txq->axq_acq, list) {
35 + last_tid = list_entry(ac->tid_q.prev, struct ath_atx_tid, list);
36 + list_del(&ac->list);
39 + while (!list_empty(&ac->tid_q)) {
40 + tid = list_first_entry(&ac->tid_q, struct ath_atx_tid,
42 + list_del(&tid->list);
50 - ath_tx_sched_aggr(sc, txq, tid);
51 + ath_tx_sched_aggr(sc, txq, tid);
54 - * add tid to round-robin queue if more frames
55 - * are pending for the tid
57 - if (!list_empty(&tid->buf_q))
58 - ath_tx_queue_tid(txq, tid);
60 + * add tid to round-robin queue if more frames
61 + * are pending for the tid
63 + if (!list_empty(&tid->buf_q))
64 + ath_tx_queue_tid(txq, tid);
66 - if (tid == last || txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
68 - } while (!list_empty(&ac->tid_q));
69 + if (tid == last_tid ||
70 + txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
74 - if (!list_empty(&ac->tid_q)) {
77 - list_add_tail(&ac->list, &txq->axq_acq);
78 + if (!list_empty(&ac->tid_q)) {
81 + list_add_tail(&ac->list, &txq->axq_acq);
85 + if (ac == last_ac ||
86 + txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH)
91 --- a/drivers/net/wireless/ath/ath9k/hw.c
92 +++ b/drivers/net/wireless/ath/ath9k/hw.c
93 @@ -369,6 +369,9 @@ static void ath9k_hw_init_config(struct
95 ah->config.ht_enable = 0;
97 + /* PAPRD needs some more work to be enabled */
98 + ah->config.paprd_disable = 1;
100 ah->config.rx_intr_mitigation = true;
101 ah->config.pcieSerDesWrite = true;
103 @@ -1949,7 +1952,8 @@ int ath9k_hw_fill_cap_info(struct ath_hw
104 pCap->rx_status_len = sizeof(struct ar9003_rxs);
105 pCap->tx_desc_len = sizeof(struct ar9003_txc);
106 pCap->txs_len = sizeof(struct ar9003_txs);
107 - if (ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
108 + if (!ah->config.paprd_disable &&
109 + ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
110 pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
112 pCap->tx_desc_len = sizeof(struct ath_desc);
113 --- a/drivers/net/wireless/ath/ath9k/hw.h
114 +++ b/drivers/net/wireless/ath/ath9k/hw.h
115 @@ -228,6 +228,7 @@ struct ath9k_ops_config {