Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2799066rdd; Sat, 13 Jan 2024 02:28:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeS5zbCSjzyBYxDDCT8lT2zDVagp+/gefAAHkmMpSIz/0Mard+NXStFLCEqp4yi8qfk860 X-Received: by 2002:a17:907:3a98:b0:a28:a1:deaa with SMTP id fh24-20020a1709073a9800b00a2800a1deaamr703198ejc.76.1705141726154; Sat, 13 Jan 2024 02:28:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705141726; cv=none; d=google.com; s=arc-20160816; b=VlMFlDfymw6Zb51dZ9Wx+ELPRbhOtUjA0yBa2czxm8vUKxWNfZXHpfxblmX76X0dRe zYMToKLDDLM3jAJ0hnjtFflmuU8R1QdxLXERvoReOtkdDmugT5sb2U6q2XP4fTaL56w2 qymmXpOslME4yKbqyw6BVXGlxgZNlgBMNxZ0W9yxBl4SGU/ROP2pFWajT9bOTdvVyx2r IMEzlDkDGWXJHmsnZIq67q/y4qf0MM6HBbhSWK29nh7mBkACOk6Rqgb5y9dVlcrLehWI 3/fSdqdohPkIAYU8GzOnbG7iQsmFCjeLab79qrY2G5lJc2BauWm6bzSD4VfYx16h46TK CKjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=lrlH0dI/rLGPYpeW0qH4BHPJwFKQcBa4W+d2qHa/7vc=; fh=/o+MP+azZP68dmI/LOIydU6yMxZXrCimtK3Fz+r16+w=; b=E+h1q5O44Z0E/VoBGZN4NoJCGpR7we3BMbMT0CrP7Yw0Sgd6MbbxoT4mO6EMPopu2q WILUVCAk1CJiRPX0yhb/d0xUZgOHcxJEhk/p39+gPLoQoImYjbhHJkmdO7gZuin4n4Db 2iQqMDZbUGL3ZQK7mEyC94LR7X9/dzoVyqlPJZZqNOIyl3XTk3mVuFbuTdjDy3C4mrWJ bSAsnYp1Ix3vsio8J2/Qu4vi/hU+DBaoGcTlFm3z9teZLrN3+OYVcAMKADsJSiJyIMvU 8cXtcDPpKNBLPT7WfNx1nWp4IMZU9BzcDid70sNLdxIoO283pjFtvJoYdtAZYh1fC3PR Yzng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j3PCvLUm; spf=pass (google.com: domain of linux-wireless+bounces-1874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kh11-20020a170906f80b00b00a2ac23652e0si2053910ejb.227.2024.01.13.02.28.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 02:28:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j3PCvLUm; spf=pass (google.com: domain of linux-wireless+bounces-1874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E1C5D1F216B8 for ; Sat, 13 Jan 2024 10:28:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 463F118EA8; Sat, 13 Jan 2024 10:26:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="j3PCvLUm" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2183118E38; Sat, 13 Jan 2024 10:26:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 371DDC433F1; Sat, 13 Jan 2024 10:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705141616; bh=JFI/sg9PG8bnP6shSEl0PaqRN8tCMbNQeFxvpUYK4tU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=j3PCvLUmYJFRYZIniSh4Vb51WLTdh9rzhALwc4E+Xmuzk37yJU3u3xFKcKB5inpTl dQ6lcf8I0iSHk5+9ZHifVBhNp1/jGC2L6pzO9hzdFFteQi00Muw2CnaMG+MaNyOkOS RJpuoKU45iQfqdWJ0jblk+EZQUNyGdR7+JYZhusJDCaZC4uLYbDHHjpDeYUceCS38+ NWCfN/85UD0KJ2O5DC05YEYdzliR6OpnFRPkeMGIsBfhE51pHv+jX2Bs/22UXjvSeM ivZVD93M3fZbOkayTKoh/o88yKvrKWBlspoIjBwNavs9+Vom9kKWAA1RY/LOCPuMNa +O1uruxECWEaw== From: Kalle Valo To: Johan Hovold Cc: Johan Hovold , Jeff Johnson , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: ath11k: checking RCU usage References: <20231019153115.26401-1-johan+linaro@kernel.org> <87o7goxget.fsf@kernel.org> Date: Sat, 13 Jan 2024 12:26:53 +0200 In-Reply-To: (Johan Hovold's message of "Tue, 24 Oct 2023 17:17:56 +0200") Message-ID: <87zfx98r6a.fsf_-_@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain (old discussion, changing title) Johan Hovold writes: > On Tue, Oct 24, 2023 at 05:07:38PM +0300, Kalle Valo wrote: > >> Johan Hovold writes: >> >> > RCU lockdep reported suspicious RCU usage when accessing the temperature >> > sensor. Inspection revealed that the DFS radar event code was also >> > missing the required RCU read-side critical section marking. >> > >> > Johan >> > >> > >> > Changes in v2 >> > - add the missing rcu_read_unlock() to an >> > ath11k_wmi_pdev_temperature_event() error path as noticed by Jeff >> > >> > >> > Johan Hovold (2): >> > wifi: ath11k: fix temperature event locking >> > wifi: ath11k: fix dfs radar event locking >> >> Thanks for the fixes. I really like using lockdep_assert_held() to >> document if a function requires some lock held, is there anything >> similar for RCU? > > Not really, but the checking is instead built into the primitives like > rcu_dereference() and enabled whenever CONFIG_PROVE_RCU is set. > > For some special cases, we have open-coded checks like: > > RCU_LOCKDEP_WARN(!rcu_read_lock_held()); > > which similarly depend on CONFIG_PROVE_RCU or simply > > WARN_ON_ONCE(!rcu_read_lock_held()); I just found out that sparse has __must_hold(): https://lore.kernel.org/linux-wireless/87sf31hhfp.fsf@kernel.org/ That looks promising, should we start using that in ath11k and ath12k to check our RCU usage? -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches