Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1615596pxb; Fri, 26 Feb 2021 16:10:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMbSR9oiYbPgsOkO+tuBjehG6j2x6pl6RBKmO1MUAyC4X6AB+KrOUfsB+aJYF7zvSTHjgx X-Received: by 2002:a17:906:4f8a:: with SMTP id o10mr5976134eju.484.1614384617455; Fri, 26 Feb 2021 16:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614384617; cv=none; d=google.com; s=arc-20160816; b=P8R9gz8lDxTc0WuK3Dh1t+eFaQapRb+0fb4nMQjqjg6C54k6PiXJpzD2QQwMRAHTOi bsst4OjqT1dsFCX7TRXpy4I4c0fT4YK4HFR2KDCUfdbTg/c75Zz1GQUj7phhL6I1t46b 1rPCR9Zz1LwtYCG6c3gqsqjh52oeu0guzzLl0L/vz8rg7nc0Y5q7fOLPgP81ceFnSDGX /sYhWl4Z2jk+lexBH55VBk2sbIcTGSD3toWmpdnE9p/isPESuTBeQIbQZoyA+k+hB4NR T0USn4GgICUBsgC4F7y5jW1Guyw2ozdE1E4qrJSss5T2UNd1eKjEevNCu8dWFLH3vjrf 9p7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KDyipOQ/zGVT/OsO6YP4rsNag+Kuytihig+gLKvB9Z8=; b=UkDwg+Dktc7B58RdADAzk2lm5pQkNEFLkeoT/sYLNqhs92g1Rjog/rVV4ycU8xrZt2 dNoRc6l8flDqABR1msNf5/j5mRuMRESvtH7u7qw607Zx4OT8W54FlDy8uc+pYtxVfFu/ jH1kmx2b5ubJTDdjPMnCosbZswWa0Kj9Ybk3YpKKKZJuic4KN/oIzrWH0JYe8m7FCP5y qr9n5pgDVAVhtme0rUxBQFFlbB17D9LbPweyO+wzMfWiIXWr/cF3XfhIID4kamFIKDIu 8mvZWCaSUs5ctOfQ3Nu+EZyGobdOUkDm8N0fPtj7BFygItM77nOtvrmQTTy1ZfpTbRR6 fgjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=LaYZeGoz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si6887037ejb.447.2021.02.26.16.09.55; Fri, 26 Feb 2021 16:10:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=LaYZeGoz; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbhB0AIc (ORCPT + 99 others); Fri, 26 Feb 2021 19:08:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230087AbhB0AIZ (ORCPT ); Fri, 26 Feb 2021 19:08:25 -0500 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDDB0C0617A7 for ; Fri, 26 Feb 2021 16:07:07 -0800 (PST) Received: by mail-il1-x12d.google.com with SMTP id q5so9532476ilc.10 for ; Fri, 26 Feb 2021 16:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KDyipOQ/zGVT/OsO6YP4rsNag+Kuytihig+gLKvB9Z8=; b=LaYZeGozYDZh8m9Zcr5DguvGQyzVvG1qk6+v/7FntdsL/I3sVG06wPjHdPnjcZrUET xY5SJ7hU/xLUPFWSmJiJh2JucnddnVTTkkP5NzwA29W6K1xcDQ1SIXbxGUPeBds0IIBb /0QQjolx3Ez78Pr0DP8b/cqMkvnkaddIjzBWY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KDyipOQ/zGVT/OsO6YP4rsNag+Kuytihig+gLKvB9Z8=; b=kXAaSxnYqKL2U+RgOdI/LXIvoIuNWY9XqmxJAbAUUQNSv5z4YUCaVRGb7RuWp7U9AV 2Tx+vKMQdklq08+OBgCwNJXlXgpb7TPtRcCQNyP7B0f5iYDRIjW9SurPwQ5Orycl3GuS p3UhbcVA8TgOopIsP2aA5qcg9jKJV9onYhXyeJf4BA1NM5S6nLHRdwyLeHG+3mzuR9T2 GAnTylfuBpSRNPVgheKib3hMvX64Qw/MaFffWGD+Gfdo4PIReTVyppE0GY441ALwExMv Za4ACqgzoktKjZRzRBksHlm4uZYtsm6y7TsKdsfiHY6z/mEEYrp0KKsylepSuUyDR85k 4VeQ== X-Gm-Message-State: AOAM533m60aSgaWqdN9Cmyco7xMYmQ/wxKmGnS9KkDlwphqWWKVcXJsH PEYOUMWC8Muj/T3yQZ+M3e1ttQ== X-Received: by 2002:a92:cd8a:: with SMTP id r10mr4471884ilb.110.1614384427380; Fri, 26 Feb 2021 16:07:07 -0800 (PST) Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id w16sm5228805ilh.35.2021.02.26.16.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Feb 2021 16:07:07 -0800 (PST) From: Shuah Khan To: peterz@infradead.org, mingo@redhat.com, will@kernel.org, kvalo@codeaurora.org, davem@davemloft.net, kuba@kernel.org Cc: Shuah Khan , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] ath10k: detect conf_mutex held ath10k_drain_tx() calls Date: Fri, 26 Feb 2021 17:07:00 -0700 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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. Link: https://lore.kernel.org/lkml/37a29c383bff2fb1605241ee6c7c9be3784fb3c6.1613171185.git.skhan@linuxfoundation.org/ Link: https://lore.kernel.org/linux-wireless/871rdmu9z9.fsf@codeaurora.org/ Acked-by: Kalle Valo Signed-off-by: Shuah Khan --- 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 bb6c5ee43ac0..5ce4f8d038b9 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4727,6 +4727,8 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, /* 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(); -- 2.27.0