From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47C54C433E0 for ; Sat, 6 Mar 2021 11:56:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 14AEA6501B for ; Sat, 6 Mar 2021 11:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230445AbhCFLzS (ORCPT ); Sat, 6 Mar 2021 06:55:18 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:34706 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbhCFLyf (ORCPT ); Sat, 6 Mar 2021 06:54:35 -0500 Date: Sat, 06 Mar 2021 11:54:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1615031674; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xoum3UnD0wjqttWbj/RvLZ1mxSBsNXJPFP5gnUoxlkU=; b=2pmqi3WK6wnhO/+dX+wlUt6fXV9v04wVyd2M9WuGaBvHIO9zSelEBurzd8/uUcZ3C/Wfvy 1wS/WHdfAOCliWrurfPlxiK1wSCKgNSfa5oa/c5cUhmoNqxsKnaQo/8LSAr2pT7yEpYRnC 3qLqgFs6yvwkdargvKC1Lh4Ldkt5FFztv/Sv4uP95FZOsowPIbtZ7LDaA68vzWXq5tZTEy lZfThmm9fPg85YQTPISM95K5Iok9qa7T8GlK7YcXiePhLGrRfwRd6a4luLTdoTh8pefeRA ycX26rs7j5t8gX9wYbxhz4EV5lRDecOl5+qNmon9i0CPn9LvAFHsoJmAd+6ZBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1615031674; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xoum3UnD0wjqttWbj/RvLZ1mxSBsNXJPFP5gnUoxlkU=; b=IzQ/WQDIlz+9gKNBtcIUbK2iGfjrQpb1hiKfP7BHZrcPtMw7Oiky0ePhrVeQX0sacQCUm0 CS+/DpNaNGLEIyDQ== From: "tip-bot2 for Shuah Khan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] ath10k: Detect conf_mutex held ath10k_drain_tx() calls Cc: Shuah Khan , "Peter Zijlstra (Intel)" , Ingo Molnar , Kalle Valo , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <161503167413.398.1632860817242028005.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: bdb1050ee1faaec1e78c15de8b1959176f26c655 Gitweb: https://git.kernel.org/tip/bdb1050ee1faaec1e78c15de8b1959176f26c655 Author: Shuah Khan AuthorDate: Fri, 26 Feb 2021 17:07:00 -07:00 Committer: Ingo Molnar CommitterDate: Sat, 06 Mar 2021 12:51:15 +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 Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Kalle Valo 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();