ath10k: merge some more pending upstream fixes
[openwrt/openwrt.git] / package / kernel / mac80211 / patches / 311-ath10k-fix-deadlock-while-processing-rx_in_ord_ind.patch
1 From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
2 Date: Thu, 9 Jun 2016 11:33:55 +0530
3 Subject: [PATCH] ath10k: fix deadlock while processing rx_in_ord_ind
4
5 commit 5c86d97bcc1d ("ath10k: combine txrx and replenish task")
6 introduced deadlock while processing rx in order indication message
7 for qca6174 based devices. While merging replenish and txrx tasklets,
8 replenish task should be called out of htt rx ring locking since it
9 is also try to acquire the same lock.
10
11 Unfortunately this issue is not exposed by other solutions (qca988x,
12 qca99x0 & qca4019), as rx_in_ord_ind message is specific to qca6174
13 based devices. This patch fixes
14
15 =============================================
16 [ INFO: possible recursive locking detected ]
17 4.7.0-rc2-wt-ath+ #1353 Tainted: G E
18 ---------------------------------------------
19 swapper/3/0 is trying to acquire lock:
20 (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d7ef19>]
21 ath10k_htt_rx_msdu_buff_replenish+0x29/0x90 [ath10k_core]
22
23 but task is already holding lock:
24 (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d82cab>]
25 ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core]
26
27 other info that might help us debug this:
28 Possible unsafe locking scenario:
29
30 CPU0
31 ----
32 lock(&(&htt->rx_ring.lock)->rlock);
33 lock(&(&htt->rx_ring.lock)->rlock);
34
35 *** DEADLOCK ***
36
37 May be due to missing lock nesting notation
38
39 1 lock held by swapper/3/0:
40 #0: (&(&htt->rx_ring.lock)->rlock){+.-...}, at: [<f8d82cab>]
41 ath10k_htt_txrx_compl_task+0x21b/0x250 [ath10k_core]
42
43 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=119151
44 Fixes: 5c86d97bcc1d ("ath10k: combine txrx and replenish task")
45 Reported-by: Mike Lothian <mike@fireburn.co.uk>
46 Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
47 Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
48 ---
49
50 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
51 +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
52 @@ -1904,7 +1904,6 @@ static void ath10k_htt_rx_in_ord_ind(str
53 return;
54 }
55 }
56 - ath10k_htt_rx_msdu_buff_replenish(htt);
57 }
58
59 static void ath10k_htt_rx_tx_fetch_resp_id_confirm(struct ath10k *ar,