Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4307072rwl; Mon, 3 Apr 2023 03:05:50 -0700 (PDT) X-Google-Smtp-Source: AKy350aeD90WzcfMHrs9hsA9g133PBwQI6eOnXOMCi8fDXKzvXLuEV1izOlMZ3d0y0bF3HMP+R13 X-Received: by 2002:aa7:9ad5:0:b0:5a8:8535:18b with SMTP id x21-20020aa79ad5000000b005a88535018bmr29782467pfp.11.1680516350265; Mon, 03 Apr 2023 03:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680516350; cv=none; d=google.com; s=arc-20160816; b=aYzFxyl2jlDiAwlyHKwSK7DKd5B2X9+1bGnNHcMUU+NUh4Rh7hB6lYo7GJc9NsDWF+ 7pF23GFDuVwy4jcoB+CPROJxZcqisR68aIU4mhZNYfgMTPYNBIhocQHlLiCkM+cIlfrN Zhd7z3PjVrdu4Z8gLrIjMZn15cbsmuSpvGxBdEeRLwGzxw+1en4KnqwjvojOWPYTt1qM idEUw+8XMzX+KDc3r0LImgotvn5CHE282JPCe1bLjBMYr+A9DkgHwkQ5fnulHR+qhPrV P/+RI3Yf1CpwnH5gKEOGRfghdfJPjxNsByg8VrYGWmUaXo021IRHUoDzArVZWXRr4Rqr cgNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KdikWuJv48Fx6+FJXMCcZaVnTLNEj8A1IkmHnbmPkBY=; b=O3JPNqYQ6uzwMaEM8ZzDd8VZPCA5O4rPRtpHmG6dTs1pV8/J0XLocS5PY0+NoX2OTk SVEGugv6R+QfpW8JM5QmMiFAlN5nzpCBSBQ7bc5UNZ8UGFrjCo9wNVj1CTHxfO0lHBMC ODSNNafVSgvMTdaqMTqh4An5svg8eHyKRBeZuilc+AxxrFFpxKd1Jgehim2OFVXUeP1g /qOAGTNfcD/3/6PXdjKiuw/zLqiT8qzov9nrWaKMJo0JkP9GN2UG/1FbOGAoIl6xwho5 wSkT06gRT1MwgnFaW9V59YHOb3Hg/1Sk7jvgVkDtcuPK4Y2mm2lunKeYmBy/v2qlK+bK QfJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t12-20020a63460c000000b00513955d67e7si7875010pga.342.2023.04.03.03.05.39; Mon, 03 Apr 2023 03:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231928AbjDCKA4 (ORCPT + 59 others); Mon, 3 Apr 2023 06:00:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231804AbjDCKAw (ORCPT ); Mon, 3 Apr 2023 06:00:52 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F04D2D52 for ; Mon, 3 Apr 2023 03:00:51 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjGzU-0006Ex-Sr; Mon, 03 Apr 2023 12:00:44 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1pjGzT-0001wu-Dc; Mon, 03 Apr 2023 12:00:43 +0200 Date: Mon, 3 Apr 2023 12:00:43 +0200 From: Sascha Hauer To: Martin Blumenstingl Cc: linux-wireless@vger.kernel.org, tony0620emma@gmail.com, kvalo@kernel.org, pkshih@realtek.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: Re: [PATCH v3 1/3] wifi: rtw88: Move register access from rtw_bf_assoc() outside the RCU Message-ID: <20230403100043.GT19113@pengutronix.de> References: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> <20230108211324.442823-2-martin.blumenstingl@googlemail.com> <20230331125906.GF15436@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Martin, On Sat, Apr 01, 2023 at 11:30:40PM +0200, Martin Blumenstingl wrote: > Hi Sascha, > > On Fri, Mar 31, 2023 at 2:59 PM Sascha Hauer wrote: > > > > On Sun, Jan 08, 2023 at 10:13:22PM +0100, Martin Blumenstingl wrote: > > > USB and (upcoming) SDIO support may sleep in the read/write handlers. > > > Shrink the RCU critical section so it only cover the call to > > > ieee80211_find_sta() and finding the ic_vht_cap/vht_cap based on the > > > found station. This moves the chip's BFEE configuration outside the > > > rcu_read_lock section and thus prevent "scheduling while atomic" or > > > "Voluntary context switch within RCU read-side critical section!" > > > warnings when accessing the registers using an SDIO card (which is > > > where this issue has been spotted in the real world - but it also > > > affects USB cards). > > > > Unfortunately this introduces a regression on my RTW8821CU chip. With > > this it constantly looses connection to the AP and reconnects shortly > > after: > Sorry to hear this! This is odd and unfortunately I don't understand > the reason for this. > rtw_bf_assoc() is only called from > drivers/net/wireless/realtek/rtw88/mac80211.c with rtwdev->mutex held. > So I don't think that it's a race condition. > > There's a module parameter which lets you enable/disable BF support: > $ git grep rtw_bf_support drivers/net/wireless/realtek/rtw88/ | grep param > drivers/net/wireless/realtek/rtw88/main.c:module_param_named(support_bf, > rtw_bf_support, bool, 0644); I was a bit too fast reporting this. Yes, there seems to be a problem with the RTW8821CU, but it doesn't seem to be related to this patch. Sorry for the noise. The chipset seems to have problems with one access point that I have and I can see these problems with or without the patch. Maybe NetworkManager decided to connect to another accesspoint without me noticing it, making it look to me as if this patch was guilty. Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |