Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp426063rdb; Thu, 19 Oct 2023 08:18:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHxo88Ce+b4u/DdvaeLj0i0mWRYIVbgbZglHasHNTcI7YpaFnk0fUSzDAarE+lrCBwpuMzQ X-Received: by 2002:a05:6a00:150c:b0:693:4a43:1c7e with SMTP id q12-20020a056a00150c00b006934a431c7emr2266030pfu.29.1697728692956; Thu, 19 Oct 2023 08:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697728692; cv=none; d=google.com; s=arc-20160816; b=Sl1lcE9se9sl0qYZnaReQicusZMV/epgCwMjEyt++Og9IGzeg1Lf1v5pHQ11yVSU+B i3+CrYUqTp7Tt7Q9a7ipe/WwpMguxMTU6Ki/tscNoUdX+5c+Csvfly6z8thfAE1pLZUh CFRE9HrFVDFi32HDghbwCJGuqzDiA5rePfvEmoTON3mGT7ezqun9Twi5poIAcYELZbRq yJ5vGll3hsWmhzBSxYPa4CRDpjt12V1xeZZ0yUnI4zxhYzR8lzmo2E7JPp04kJH8mRdF DkVUKqNUe95ydNTq4UWybHm5xMHYHhcIb6ov4/KzWpzhCrQ8CRlWE+arDaPaN972/ovz KPaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eXa0rs+i8kEsJX4W4ydVWdaF9Y7KfY/lao+a3R6PCu0=; fh=0w4lkmZlMvMV0fQ3SZQxZWCcoaIAhbPTISYjFtdG9so=; b=AiT9UkGCOiuctAuRYdAmqJoWLZNMUrDeglJ+5Rv1kVmW8sGhJDd6YdXby8Uncnmf4r YcwMi1u9LLPZjVJnUmay7sTIegR0jtcFKzVZsEGkZpxPhBIYdtXlHzpJKYJGD9wLnX9z Rm90m3AnWqToJWCdrE3Ukdu7TGghFh9l4rr4Iy3encbM9z46fvtDUQDGVKaXVUu5HDO2 h1uD/Cs9eBM/FhxCbi4VJ2FOQqjdj6BGhV+uAy1vzYP8puxotipd4eKys8LsI7cDQNcN coUAhDYobFrT+QnztwJbK/c12pb2Bhz4gROPjm6AsVCQrafyiqg/AaOEYrYLCzdNXVhj pxTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ueOCtb8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id n5-20020aa79845000000b006be062e4ecbsi6295352pfq.32.2023.10.19.08.18.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 08:18:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ueOCtb8T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 594BA8087250; Thu, 19 Oct 2023 08:17:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345450AbjJSPRl (ORCPT + 99 others); Thu, 19 Oct 2023 11:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbjJSPRk (ORCPT ); Thu, 19 Oct 2023 11:17:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7088B11B; Thu, 19 Oct 2023 08:17:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06E51C433C7; Thu, 19 Oct 2023 15:17:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697728659; bh=WtVNBWC5iNjbnScpjiJDxp8GdsgsTgsH5bVGO2dnDFk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ueOCtb8TLybx9AXSOcBSm2CkxjqD3rXqlLe1hBgQL4guFYt9A9ld77Tg2HjbC6I2O 6GlFAo/ZlGKnRsw3N3mRy0cvXRyzLjTlWP+VGrLngQMb3movYXiFNSxTSOzAU9U2mG UoHaq0cADAyCel5zgFycAu8fqXLvYg0u/zeKKfgyF3JPWAGx7zN2CFhWPH1s2snv8M X5cRVu/cCbZa5jN/INltP35xMFxOzRNYAFRbj0r1TWHKmkq6eHkRLkvRCg8ZVp7jCJ 2jTmgBsPOMXsx4+ot11p7+juPto3ClaY9SxL/ui8wZ8V0HQf3MO7wDKgU0q9AiQ//8 Fb/KK4JAtRLfg== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qtUmL-0005Sf-2m; Thu, 19 Oct 2023 17:17:42 +0200 Date: Thu, 19 Oct 2023 17:17:41 +0200 From: Johan Hovold To: Jeff Johnson Cc: Johan Hovold , Kalle Valo , Pradeep Kumar Chitrapu , ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/2] wifi: ath11k: fix temperature event locking Message-ID: References: <20231019104211.13769-1-johan+linaro@kernel.org> <20231019104211.13769-2-johan+linaro@kernel.org> <4233c8af-5911-40bf-b5ba-dd0a63863a45@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4233c8af-5911-40bf-b5ba-dd0a63863a45@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 08:17:58 -0700 (PDT) On Thu, Oct 19, 2023 at 08:04:55AM -0700, Jeff Johnson wrote: > On 10/19/2023 3:42 AM, Johan Hovold wrote: > > The ath11k active pdevs are protected by RCU but the temperature event > > handling code calling ath11k_mac_get_ar_by_pdev_id() was not marked as a > > read-side critical section as reported by RCU lockdep: > > How do I enable this? Just enable CONFIG_PROVE_RCU? Yeah, via CONFIG_PROVE_LOCKING. > Of course I'd also need to exercise the code path... Right, this one I hit when reading out the sensor temperature (e.g. using lm_sensors). > > + rcu_read_lock(); > > + > > ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id); > > if (!ar) { > > ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id); > > aren't you missing an unlock() in this error path? > > perhaps have a goto cleanup that does both the unlock() and the kfree()? Bah, I am, thanks for catching that. Spent too much time on scanning for further instances that I didn't check the first one properly. Sorry about that. Will send a v2. Johan