Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5729715rwl; Thu, 29 Dec 2022 01:51:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvgCRoWCUaTpJAWiRuZNdMWko96rfuj07iicnACVEfAPrJTrKHjJ7pvbRgS28SjEr5UaCX/ X-Received: by 2002:a17:907:d602:b0:7c1:286a:d87c with SMTP id wd2-20020a170907d60200b007c1286ad87cmr23785953ejc.65.1672307497376; Thu, 29 Dec 2022 01:51:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672307497; cv=none; d=google.com; s=arc-20160816; b=oGqb7X7akg2uLXzWUCoaxFUB+/068GjASJmpISGYYQJbnffW9onDuOiECXzYeV4HwP 2RtNKXKzafYyyIr8+A49rRyBXq/WHUrcY3qQJeZZbLOAFKEzcdd+scVdknzz0HBuLq7J uZ2fP5b3MbPn4xP9gOMxpmwWjeUzya4AClggJgbPSARqSRV5ibLhMqUTHMH7YQt34Lsk GkfQ5jukJRBM539XNSOXhFA+l6F1g6KfsouB2qIyzl1v+ztJ2K1KdKkygqvtiBk/b0rQ mVvi+oHTQiurGkmuMcgMWBGUPpzVjaU0cvDAzNy81WDU81COUwKiH3RusPbAE08whTQY hQbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:authenticated-by; bh=vbQIKIcgUtN0BIF9rtVwtianbarXz4PkfevaS2TmUS8=; b=dckZ4MoDmHbLoK/ZW/vOLVyUs7pB+jvo0kUrGkoVBqo3CYIMJq7BSDI9jVxCKsd4Yi iaoIR9O8F/OtXlVPaUjgai8NbNRhEWaMD9c7ihuj6UC7v8/V65AReweoj2IVB1eozZTK NgJtjIaVxXF7B+1PGvmgRzIWv59JS84v9RMOOKC21D+zWlXkXDpUAFlPDEjk2t3x7Xps 8lFbcCfY8RiMa/Iga00G1Uz4Sf0yDLhloikcxO2dq6uundltNObbE+2tbHKfAWbG6Y/S 5vA6/PwbH+ieJzh/JoF75PiLtroiNBM2mZzp0gpsNd5JCFqokhlJdjV8+icINvPOzX3K 9TIQ== 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 go31-20020a1709070d9f00b00783b75ec298si16313424ejc.395.2022.12.29.01.51.20; Thu, 29 Dec 2022 01:51:37 -0800 (PST) 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 S233217AbiL2Jmo convert rfc822-to-8bit (ORCPT + 67 others); Thu, 29 Dec 2022 04:42:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233240AbiL2Jkm (ORCPT ); Thu, 29 Dec 2022 04:40:42 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40A5512D29; Thu, 29 Dec 2022 01:39:38 -0800 (PST) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 2BT9cUM21026268, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 2BT9cUM21026268 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Thu, 29 Dec 2022 17:38:30 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Thu, 29 Dec 2022 17:39:24 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Thu, 29 Dec 2022 17:39:24 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::15b5:fc4b:72f3:424b]) by RTEXMBS04.realtek.com.tw ([fe80::15b5:fc4b:72f3:424b%5]) with mapi id 15.01.2375.007; Thu, 29 Dec 2022 17:39:24 +0800 From: Ping-Ke Shih To: Martin Blumenstingl , "linux-wireless@vger.kernel.org" CC: "tony0620emma@gmail.com" , "kvalo@kernel.org" , "tehuang@realtek.com" , "s.hauer@pengutronix.de" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 4/4] rtw88: Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update() Thread-Topic: [PATCH 4/4] rtw88: Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update() Thread-Index: AQHZGsFuDJ0s6Ba8rkOgPtvNKrTJ9K6EnVFQ Date: Thu, 29 Dec 2022 09:39:24 +0000 Message-ID: References: <20221228133547.633797-1-martin.blumenstingl@googlemail.com> <20221228133547.633797-5-martin.blumenstingl@googlemail.com> In-Reply-To: <20221228133547.633797-5-martin.blumenstingl@googlemail.com> Accept-Language: en-US, zh-TW Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.21.69.188] x-kse-serverinfo: RTEXMBS04.realtek.com.tw, 9 x-kse-attachmentfiltering-interceptor-info: no applicable attachment filtering rules found x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: =?us-ascii?Q?Clean,_bases:_2022/12/29_=3F=3F_07:25:00?= x-kse-bulkmessagesfiltering-scan-result: protection disabled Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 > -----Original Message----- > From: Martin Blumenstingl > Sent: Wednesday, December 28, 2022 9:36 PM > To: linux-wireless@vger.kernel.org > Cc: tony0620emma@gmail.com; kvalo@kernel.org; Ping-Ke Shih ; tehuang@realtek.com; > s.hauer@pengutronix.de; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Martin Blumenstingl > > Subject: [PATCH 4/4] rtw88: Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update() > > USB and (upcoming) SDIO support may sleep in the read/write handlers. > Use non-atomic rtw_iterate_stas() in rtw_ra_mask_info_update() because > the iterator function rtw_ra_mask_info_update_iter() needs to read and > write registers from within rtw_update_sta_info(). Using the non-atomic > iterator ensures that we can sleep during USB and SDIO register reads > and writes. This fixes "scheduling while atomic" or "Voluntary context > switch within RCU read-side critical section!" warnings as seen by SDIO > card users (but it also affects USB cards). > > Fixes: 78d5bf925f30 ("wifi: rtw88: iterate over vif/sta list non-atomically") > Suggested-by: Ping-Ke Shih > Signed-off-by: Martin Blumenstingl Reviewed-by: Ping-Ke Shih > --- > drivers/net/wireless/realtek/rtw88/mac80211.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c > b/drivers/net/wireless/realtek/rtw88/mac80211.c > index 776a9a9884b5..3b92ac611d3f 100644 > --- a/drivers/net/wireless/realtek/rtw88/mac80211.c > +++ b/drivers/net/wireless/realtek/rtw88/mac80211.c > @@ -737,7 +737,7 @@ static void rtw_ra_mask_info_update(struct rtw_dev *rtwdev, > br_data.rtwdev = rtwdev; > br_data.vif = vif; > br_data.mask = mask; > - rtw_iterate_stas_atomic(rtwdev, rtw_ra_mask_info_update_iter, &br_data); > + rtw_iterate_stas(rtwdev, rtw_ra_mask_info_update_iter, &br_data); > } > > static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw, > @@ -746,7 +746,9 @@ static int rtw_ops_set_bitrate_mask(struct ieee80211_hw *hw, > { > struct rtw_dev *rtwdev = hw->priv; > > + mutex_lock(&rtwdev->mutex); > rtw_ra_mask_info_update(rtwdev, vif, mask); > + mutex_unlock(&rtwdev->mutex); > > return 0; > } > -- > 2.39.0