From: Evan Green <evgreen@chromium.org> To: Kalle Valo <kvalo@codeaurora.org> Cc: kuabhs@google.com.org, sujitka@chromium.org, Evan Green <evgreen@chromium.org>, "David S. Miller" <davem@davemloft.net>, Govind Singh <govinds@qti.qualcomm.com>, Jakub Kicinski <kuba@kernel.org>, Michal Kazior <michal.kazior@tieto.com>, ath10k@lists.infradead.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH] ath10k: Acquire tx_lock in tx error paths Date: Thu, 4 Jun 2020 10:59:11 -0700 [thread overview] Message-ID: <20200604105901.1.I5b8b0c7ee0d3e51a73248975a9da61401b8f3900@changeid> (raw) 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> --- 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 e9d12ea708b62..e8c00af2cce1d 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1545,7 +1545,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; } @@ -1752,7 +1754,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.24.1
WARNING: multiple messages have this Message-ID (diff)
From: Evan Green <evgreen@chromium.org> To: Kalle Valo <kvalo@codeaurora.org> Cc: Govind Singh <govinds@qti.qualcomm.com>, kuabhs@google.com.org, sujitka@chromium.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Evan Green <evgreen@chromium.org>, ath10k@lists.infradead.org, Michal Kazior <michal.kazior@tieto.com>, Jakub Kicinski <kuba@kernel.org>, "David S. Miller" <davem@davemloft.net> Subject: [PATCH] ath10k: Acquire tx_lock in tx error paths Date: Thu, 4 Jun 2020 10:59:11 -0700 [thread overview] Message-ID: <20200604105901.1.I5b8b0c7ee0d3e51a73248975a9da61401b8f3900@changeid> (raw) 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> --- 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 e9d12ea708b62..e8c00af2cce1d 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1545,7 +1545,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; } @@ -1752,7 +1754,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.24.1 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k
next reply other threads:[~2020-06-04 17:59 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-04 17:59 Evan Green [this message] 2020-06-04 17:59 ` [PATCH] ath10k: Acquire tx_lock in tx error paths Evan Green 2020-06-08 11:38 ` Kalle Valo 2020-06-08 11:38 ` Kalle Valo 2020-06-08 16:07 ` Evan Green 2020-06-08 16:07 ` Evan Green 2020-06-09 6:23 ` Kalle Valo 2020-06-09 6:23 ` Kalle Valo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200604105901.1.I5b8b0c7ee0d3e51a73248975a9da61401b8f3900@changeid \ --to=evgreen@chromium.org \ --cc=ath10k@lists.infradead.org \ --cc=davem@davemloft.net \ --cc=govinds@qti.qualcomm.com \ --cc=kuabhs@google.com.org \ --cc=kuba@kernel.org \ --cc=kvalo@codeaurora.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-wireless@vger.kernel.org \ --cc=michal.kazior@tieto.com \ --cc=netdev@vger.kernel.org \ --cc=sujitka@chromium.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.