ath10k: merge some more pending upstream fixes
authorFelix Fietkau <nbd@nbd.name>
Fri, 17 Jun 2016 12:12:44 +0000 (14:12 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 17 Jun 2016 12:12:44 +0000 (14:12 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch [new file with mode: 0644]
package/kernel/mac80211/patches/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch [new file with mode: 0644]
package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch

diff --git a/package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch b/package/kernel/mac80211/patches/310-ath10k-improve-tx-scheduling.patch
new file mode 100644 (file)
index 0000000..81ac2db
--- /dev/null
@@ -0,0 +1,67 @@
+From: Michal Kazior <michal.kazior@tieto.com>
+Date: Mon, 23 May 2016 23:12:45 +0300
+Subject: [PATCH] ath10k: improve tx scheduling
+
+Recent changes revolving around implementing
+wake_tx_queue support introduced a significant
+performance regressions on some (slower, uni-proc)
+systems.
+
+Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
+Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
+---
+
+--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
+@@ -2291,7 +2291,6 @@ bool ath10k_htt_t2h_msg_handler(struct a
+                       ath10k_htt_tx_mgmt_dec_pending(htt);
+                       spin_unlock_bh(&htt->tx_lock);
+               }
+-              ath10k_mac_tx_push_pending(ar);
+               break;
+       }
+       case HTT_T2H_MSG_TYPE_TX_COMPL_IND:
+@@ -2442,8 +2441,6 @@ static void ath10k_htt_txrx_compl_task(u
+               dev_kfree_skb_any(skb);
+       }
+-      ath10k_mac_tx_push_pending(ar);
+-
+       num_mpdus = atomic_read(&htt->num_mpdus_ready);
+       while (num_mpdus) {
+--- a/drivers/net/wireless/ath/ath10k/mac.c
++++ b/drivers/net/wireless/ath/ath10k/mac.c
+@@ -3827,6 +3827,9 @@ void ath10k_mac_tx_push_pending(struct a
+       int ret;
+       int max;
++      if (ar->htt.num_pending_tx >= (ar->htt.max_num_pending_tx / 2))
++              return;
++
+       spin_lock_bh(&ar->txqs_lock);
+       rcu_read_lock();
+@@ -4097,9 +4100,7 @@ static void ath10k_mac_op_wake_tx_queue(
+               list_add_tail(&artxq->list, &ar->txqs);
+       spin_unlock_bh(&ar->txqs_lock);
+-      if (ath10k_mac_tx_can_push(hw, txq))
+-              tasklet_schedule(&ar->htt.txrx_compl_task);
+-
++      ath10k_mac_tx_push_pending(ar);
+       ath10k_htt_tx_txq_update(hw, txq);
+ }
+--- a/drivers/net/wireless/ath/ath10k/txrx.c
++++ b/drivers/net/wireless/ath/ath10k/txrx.c
+@@ -117,6 +117,9 @@ int ath10k_txrx_tx_unref(struct ath10k_h
+       ieee80211_tx_status(htt->ar->hw, msdu);
+       /* we do not own the msdu anymore */
++
++      ath10k_mac_tx_push_pending(ar);
++
+       return 0;
+ }
diff --git a/package/kernel/mac80211/patches/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch b/package/kernel/mac80211/patches/311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch
new file mode 100644 (file)
index 0000000..3664d70
--- /dev/null
@@ -0,0 +1,59 @@
+From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
+Date: Thu, 9 Jun 2016 11:33:55 +0530
+Subject: [PATCH] ath10k: fix deadlock while processing rx_in_ord_ind
+
+commit 5c86d97bcc1d ("ath10k: combine txrx and replenish task")
+introduced deadlock while processing rx in order indication message
+for qca6174 based devices. While merging replenish and txrx tasklets,
+replenish task should be called out of htt rx ring locking since it
+is also try to acquire the same lock.
+
+Unfortunately this issue is not exposed by other solutions (qca988x,
+qca99x0 & qca4019), as rx_in_ord_ind message is specific to qca6174
+based devices. This patch fixes
+
+=============================================
+[ INFO: possible recursive locking detected ]
+4.7.0-rc2-wt-ath+ #1353 Tainted: G            E
+---------------------------------------------
+swapper/3/0 is trying to acquire lock:
+ (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d7ef19>]
+ath10k_htt_rx_msdu_buff_replenish+0x29/0x90 [ath10k_core]
+
+but task is already holding lock:
+ (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d82cab>]
+ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core]
+
+other info that might help us debug this:
+ Possible unsafe locking scenario:
+
+       CPU0
+       ----
+  lock(&(&htt->rx_ring.lock)->rlock);
+  lock(&(&htt->rx_ring.lock)->rlock);
+
+ *** DEADLOCK ***
+
+ May be due to missing lock nesting notation
+
+1 lock held by swapper/3/0:
+ #0:  (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d82cab>]
+ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core]
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=119151
+Fixes: 5c86d97bcc1d ("ath10k: combine txrx and replenish task")
+Reported-by: Mike Lothian <mike@fireburn.co.uk>
+Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
+Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
+---
+
+--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
+@@ -1904,7 +1904,6 @@ static void ath10k_htt_rx_in_ord_ind(str
+                       return;
+               }
+       }
+-      ath10k_htt_rx_msdu_buff_replenish(htt);
+ }
+ static void ath10k_htt_rx_tx_fetch_resp_id_confirm(struct ath10k *ar,
index 92ed7a0d9a65b54d8737dd1107f446ec115cd9c2..1bfded01b04082e052d564e801707bcca5eaf529 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ath/ath10k/mac.c
 +++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -7716,6 +7716,21 @@ struct ath10k_vif *ath10k_get_arvif(stru
+@@ -7717,6 +7717,21 @@ struct ath10k_vif *ath10k_get_arvif(stru
        return arvif_iter.arvif;
  }
  
@@ -22,7 +22,7 @@
  int ath10k_mac_register(struct ath10k *ar)
  {
        static const u32 cipher_suites[] = {
-@@ -7940,6 +7955,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -7941,6 +7956,12 @@ int ath10k_mac_register(struct ath10k *a
        ar->hw->wiphy->cipher_suites = cipher_suites;
        ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);