Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp398971ybz; Fri, 24 Apr 2020 02:20:33 -0700 (PDT) X-Google-Smtp-Source: APiQypLhvGpNCWmNpKEGkN4181yNc9cQn5u18XHjB8/e6AndEvlc2HuQgOedfDPdzhyUCb5+QqgM X-Received: by 2002:a17:907:72d2:: with SMTP id du18mr6343452ejc.7.1587720033655; Fri, 24 Apr 2020 02:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587720033; cv=none; d=google.com; s=arc-20160816; b=vpbj4qf3QlcaoQcYXqdCQLVWMA466ITxulMFL/FqKyH57ACuh19z3V+kuAuGejP2Y4 Wj5L36mID9IvlXLtx34mt4KjzY917NknVFuaJAVVn2/0kN9xaytBlRvSLpiWwJS/EGnt W7hu2Uhp8Ml1HSj+9bcZjKYjYbGjRE9xEaHJKbO2JLGuws2Ao5upByYL1yue01q5vp11 EW0U5MN9Bh4NmXcTECU5hIrOVYxXkYzVRu/wBAAvm4ps4e9PHoQl3QuBsIGElK87ZSNh KnG82QqQxZpuyHPXxaiHxuSz9YVsmnEZqTgyM06JGroswAHlGuMB+lXeiaiw4Q5FBM88 MPyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=yy4XOYknARccabquD9UQSQZ/R730cXXjhbMIEZ4FuDU=; b=FaEnZda/qGqKSTfNB7t4qT4O9BJBkFIaAA+lbGtU3dSyjdTC7eAiIlHyfx/yonpTH0 m1Hayl/PaeWz/fdaJ+l5AX3mzaKatfAMrJFTU1u+SLI/GUUN+uCBFwZcxjvNYqHdVATu //MVwJREo/nfLWRt7G+QN0qxHbl503NE8tzbZv7NBpjyegOci+VW8AF1fUL6V9RhWVwF 3q+/J7pKp2AsPicHs0j/yYR7EgImibPLQdPsnk9AANpoawYdoizk2fpTNO8KaiSMV7s8 b22ZH9pJTahMDA592np7Nbf/gyq1DVh2A8zesr6STTVxJ+qkx4tzPAEbEhbg8fA6CjiW aO6A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x27si2833145ejc.450.2020.04.24.02.19.57; Fri, 24 Apr 2020 02:20:33 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726758AbgDXJTQ (ORCPT + 99 others); Fri, 24 Apr 2020 05:19:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726298AbgDXJTQ (ORCPT ); Fri, 24 Apr 2020 05:19:16 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1DCC09B045; Fri, 24 Apr 2020 02:19:15 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jRuU9-00FRAm-SI; Fri, 24 Apr 2020 11:19:01 +0200 Message-ID: <89476ee074e782175d453038396543f193f8e5fd.camel@sipsolutions.net> Subject: Re: [PATCH 1/4] net: mac80211: util.c: Fix RCU list usage warnings From: Johannes Berg To: madhuparnabhowmik10@gmail.com, davem@davemloft.net, kuba@kernel.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, frextrite@gmail.com, joel@joelfernandes.org, paulmck@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org Date: Fri, 24 Apr 2020 11:18:59 +0200 In-Reply-To: <20200409082822.27314-1-madhuparnabhowmik10@gmail.com> (sfid-20200409_102851_270381_8F58A5E1) References: <20200409082822.27314-1-madhuparnabhowmik10@gmail.com> (sfid-20200409_102851_270381_8F58A5E1) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, > This patch fixes the following warning (CONIG_PROVE_RCU_LIST) > in ieee80211_check_combinations(). Thanks, and sorry for the delay. > +++ b/net/mac80211/util.c > @@ -254,7 +254,7 @@ static void __ieee80211_wake_txqs(struct ieee80211_sub_if_data *sdata, int ac) > > sdata->vif.txqs_stopped[ac] = false; > > - list_for_each_entry_rcu(sta, &local->sta_list, list) { > + list_for_each_entry(sta, &local->sta_list, list) { > if (sdata != sta->sdata) > continue; In this case, for example, I don't even understand why the warning would happen, because certainly the only caller of this (_ieee80211_wake_txqs) does rcu_read_lock()? I'm also not convinced that the necessary lock is actually held here, this comes from a tasklet that doesn't hold any locks? I'd appreciate if you could add comments/explain why you think the changes were right, or ideally even add "lockdep_assert_held()" annotations. That would make it much easier to check this patch. > @@ -3931,7 +3932,7 @@ int ieee80211_check_combinations(struct ieee80211_sub_if_data *sdata, > params.num_different_channels++; > } > > - list_for_each_entry_rcu(sdata_iter, &local->interfaces, list) { > + list_for_each_entry(sdata_iter, &local->interfaces, list) { > struct wireless_dev *wdev_iter; > > wdev_iter = &sdata_iter->wdev; > @@ -3982,7 +3983,7 @@ int ieee80211_max_num_channels(struct ieee80211_local *local) > ieee80211_chanctx_radar_detect(local, ctx); > } > > - list_for_each_entry_rcu(sdata, &local->interfaces, list) > + list_for_each_entry(sdata, &local->interfaces, list) > params.iftype_num[sdata->wdev.iftype]++; These changes correct, as far as I can tell, in that they rely on the RTNL now - but can you perhaps document that as well? There doesn't seem to be any multi-lock version of lockdep_assert_held() or is there? That'd be _really_ useful here, because I want to get rid of some RTNL reliance in the longer term, and having annotation here saying "either RTNL or iflist_mtx is fine" would be good. johannes