| From 1e34cb897b3b3f9fa742a636832b1291b30fbd03 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Thu, 4 Jun 2020 10:59:11 -0700 |
| Subject: ath10k: Acquire tx_lock in tx error paths |
| |
| From: Evan Green <evgreen@chromium.org> |
| |
| [ Upstream commit a738e766e3ed92c4ee5ec967777276b5ce11dd2c ] |
| |
| ath10k_htt_tx_free_msdu_id() has a lockdep assertion that htt->tx_lock |
| is held. Acquire the lock in a couple of error paths when calling that |
| function to ensure this condition is met. |
| |
| Fixes: 6421969f248fd ("ath10k: refactor tx pending management") |
| Fixes: e62ee5c381c59 ("ath10k: Add support for htt_data_tx_desc_64 descriptor") |
| Signed-off-by: Evan Green <evgreen@chromium.org> |
| Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
| Link: https://lore.kernel.org/r/20200604105901.1.I5b8b0c7ee0d3e51a73248975a9da61401b8f3900@changeid |
| Signed-off-by: Sasha Levin <sashal@kernel.org> |
| --- |
| drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++++ |
| 1 file changed, 4 insertions(+) |
| |
| diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c |
| index 517ee2af2231d..e76b71e9326f5 100644 |
| --- a/drivers/net/wireless/ath/ath10k/htt_tx.c |
| +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c |
| @@ -1550,7 +1550,9 @@ static int ath10k_htt_tx_32(struct ath10k_htt *htt, |
| err_unmap_msdu: |
| dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); |
| err_free_msdu_id: |
| + spin_lock_bh(&htt->tx_lock); |
| ath10k_htt_tx_free_msdu_id(htt, msdu_id); |
| + spin_unlock_bh(&htt->tx_lock); |
| err: |
| return res; |
| } |
| @@ -1757,7 +1759,9 @@ static int ath10k_htt_tx_64(struct ath10k_htt *htt, |
| err_unmap_msdu: |
| dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); |
| err_free_msdu_id: |
| + spin_lock_bh(&htt->tx_lock); |
| ath10k_htt_tx_free_msdu_id(htt, msdu_id); |
| + spin_unlock_bh(&htt->tx_lock); |
| err: |
| return res; |
| } |
| -- |
| 2.25.1 |
| |