From: "tip-bot2 for Shuah Khan" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Shuah Khan <skhan@linuxfoundation.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Kalle Valo <kvalo@codeaurora.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: locking/core] ath10k: Detect conf_mutex held ath10k_drain_tx() calls
Date: Wed, 03 Mar 2021 08:15:58 -0000 [thread overview]
Message-ID: <161475935878.20312.1052815878297335176.tip-bot2@tip-bot2> (raw)
The following commit has been merged into the locking/core branch of tip:
Commit-ID: de469d82991b905548b5dc6539177f7b881dce1b
Gitweb: https://git.kernel.org/tip/de469d82991b905548b5dc6539177f7b881dce1b
Author: Shuah Khan <skhan@linuxfoundation.org>
AuthorDate: Fri, 26 Feb 2021 17:07:00 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Tue, 02 Mar 2021 15:06:35 +01:00
ath10k: Detect conf_mutex held ath10k_drain_tx() calls
ath10k_drain_tx() must not be called with conf_mutex held as workers can
use that also. Add call to lockdep_assert_not_held() on conf_mutex to
detect if conf_mutex is held by the caller.
The idea for this patch stemmed from coming across the comment block
above the ath10k_drain_tx() while reviewing the conf_mutex holds during
to debug the conf_mutex lock assert in ath10k_debug_fw_stats_request().
Adding detection to assert on conf_mutex hold will help detect incorrect
usages that could lead to locking problems when async worker routines try
to call this routine.
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/linux-wireless/871rdmu9z9.fsf@codeaurora.org/
---
drivers/net/wireless/ath/ath10k/mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index bb6c5ee..5ce4f8d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4727,6 +4727,8 @@ out:
/* Must not be called with conf_mutex held as workers can use that also. */
void ath10k_drain_tx(struct ath10k *ar)
{
+ lockdep_assert_not_held(&ar->conf_mutex);
+
/* make sure rcu-protected mac80211 tx path itself is drained */
synchronize_net();
next reply other threads:[~2021-03-03 13:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-03 8:15 tip-bot2 for Shuah Khan [this message]
2021-03-06 11:54 [tip: locking/core] ath10k: Detect conf_mutex held ath10k_drain_tx() calls tip-bot2 for Shuah Khan
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=161475935878.20312.1052815878297335176.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=x86@kernel.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).