From patchwork Sun Jan 8 21:13:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13092734 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE014C67871 for ; Sun, 8 Jan 2023 21:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233621AbjAHVOG (ORCPT ); Sun, 8 Jan 2023 16:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236282AbjAHVNf (ORCPT ); Sun, 8 Jan 2023 16:13:35 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E6E6565; Sun, 8 Jan 2023 13:13:34 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id ud5so15649087ejc.4; Sun, 08 Jan 2023 13:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g6bqgwx8SnsGvqrMFtHPg0KAjXh9chwbJoWM8918hmw=; b=i0RsI7bx2VQuzfi0WeLfoxFXqRLzGNyBa54n4h04kWwBbMxM1rS2WwuIHUY+IOdL7t fH7jgDLe/S8X4Rz3AOU7wE0g2dUdrB8TF1B+3iDkCE05XziNsb8daIXl6GlqqsPPd69R SwbF0rdxaP3HXwqUFWid5LK2VQLGm+60bEqpTzsKvU/t4bQmL0cPTzqEV0f5bLSxA0pG T1+aeUGf/hrpFfZBqrF6ZP7GwKG79ek9MRlMu3FYf7j28i2FlehragxsyJfFf6/fUrjA sWJS7qVN8V52uibnx97FcwkM+BCwiLEExaGZTdXvNliwWE+CfDApG824DVXj+B8h1AH4 QZBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g6bqgwx8SnsGvqrMFtHPg0KAjXh9chwbJoWM8918hmw=; b=UIqCG1I0HJgC44JWwmOzfu6Ea5JZtUCXwZ5J2BVdp4M1ICDlAOU4WwLPtMBtV1KZkd 0sSz4TF9Np0ARXooGLba53OQxttV5vWgkGryi5R/vks3L2mNrCW3REhVAWQ/Y6OUJGWp 6WGK8081RkTDUlC/AxH6XjoJDpKqNYSjY+whf5gQj49xXqybCqTw1+RJ04Xa3fxLtNOM pjflbQ/K6h8pJk7y5Domy/xQKIvuz5a4uEwB1MbEJMQsGpRhsbrCPck69tQOIy5Y2yCq cfkUPKiTE5PoMWbELyY6biGeu9vj6LU9vVoG3zoD05MdM2rmu40rl/+X1JFT22tI1nde LUjQ== X-Gm-Message-State: AFqh2krrldEYje546Re1GAu0MmhkHuJnIL3M9cjPAbtisz0m2F32iMAT CWYGLVo1UrA9uwimVxDkA8cA/zZvp6U= X-Google-Smtp-Source: AMrXdXtO6Ry2EzaKtRnlxJtEPh44IZH4kZJDTQbjH6QEMAJF4txRzjSWkABm3MEStkNW/g5tHxLvtg== X-Received: by 2002:a17:906:e2d3:b0:7c0:deb3:596a with SMTP id gr19-20020a170906e2d300b007c0deb3596amr56800096ejb.70.1673212413289; Sun, 08 Jan 2023 13:13:33 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c485-2500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c485:2500::e63]) by smtp.googlemail.com with ESMTPSA id x25-20020a170906b09900b0080345493023sm2847997ejy.167.2023.01.08.13.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 13:13:32 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, pkshih@realtek.com, s.hauer@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v3 1/3] wifi: rtw88: Move register access from rtw_bf_assoc() outside the RCU Date: Sun, 8 Jan 2023 22:13:22 +0100 Message-Id: <20230108211324.442823-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> References: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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). Reviewed-by: Ping-Ke Shih Tested-by: Sascha Hauer Signed-off-by: Martin Blumenstingl --- v1 -> v2: - Added Ping-Ke's Reviewed-by (thank you!) v2 -> v3: - Added Sascha's Tested-by (thank you!) - added "wifi" prefix to the subject and reworded the title accordingly drivers/net/wireless/realtek/rtw88/bf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/bf.c b/drivers/net/wireless/realtek/rtw88/bf.c index 038a30b170ef..c827c4a2814b 100644 --- a/drivers/net/wireless/realtek/rtw88/bf.c +++ b/drivers/net/wireless/realtek/rtw88/bf.c @@ -49,19 +49,23 @@ void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, sta = ieee80211_find_sta(vif, bssid); if (!sta) { + rcu_read_unlock(); + rtw_warn(rtwdev, "failed to find station entry for bss %pM\n", bssid); - goto out_unlock; + return; } ic_vht_cap = &hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap; vht_cap = &sta->deflink.vht_cap; + rcu_read_unlock(); + if ((ic_vht_cap->cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE) && (vht_cap->cap & IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) { if (bfinfo->bfer_mu_cnt >= chip->bfer_mu_max_num) { rtw_dbg(rtwdev, RTW_DBG_BF, "mu bfer number over limit\n"); - goto out_unlock; + return; } ether_addr_copy(bfee->mac_addr, bssid); @@ -75,7 +79,7 @@ void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, (vht_cap->cap & IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE)) { if (bfinfo->bfer_su_cnt >= chip->bfer_su_max_num) { rtw_dbg(rtwdev, RTW_DBG_BF, "su bfer number over limit\n"); - goto out_unlock; + return; } sound_dim = vht_cap->cap & @@ -98,9 +102,6 @@ void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, rtw_chip_config_bfee(rtwdev, rtwvif, bfee, true); } - -out_unlock: - rcu_read_unlock(); } void rtw_bf_init_bfer_entry_mu(struct rtw_dev *rtwdev, From patchwork Sun Jan 8 21:13:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13092732 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E575C54EBD for ; Sun, 8 Jan 2023 21:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233553AbjAHVOD (ORCPT ); Sun, 8 Jan 2023 16:14:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236297AbjAHVNh (ORCPT ); Sun, 8 Jan 2023 16:13:37 -0500 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F4C6561; Sun, 8 Jan 2023 13:13:36 -0800 (PST) Received: by mail-ej1-x634.google.com with SMTP id fy8so15549775ejc.13; Sun, 08 Jan 2023 13:13:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g+ySspNK+qn7cGndVAzvLNa0iYoPa0lwfvSj5/ykqfE=; b=aL57deV61/F3g3uWw0izEm1oYWQVgQWiv/vyY4wQMGCcRmid3omVIVbY59xnzsVoDH oNI04p4s9XzIeCTcl6HEArKH6IduQvJITp0QsRm02joAOSEP8vZeV6uhUHrjWc4tUv/O FMtTU2DUgOTYK+hIc7uRnoWQ7N4K4F2uZqBaOQvSM6EyZu9NLqCx2Ivv+Lj874arFBTe n4Au4U0xtXpLabNKDdrq6q95fNHDYJfGSSaU1JZ7mEy1sZfRR1ZYfcvtNMZxYgbSU6L2 Ghl7kWbSBExC3x2UpKRp8d5SknFp3L3YtMcbBUj4Sc1Edz+pDA5m/kedvSjn6o0Kvxzk VDew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g+ySspNK+qn7cGndVAzvLNa0iYoPa0lwfvSj5/ykqfE=; b=wECyGPrhfQhxANR//DK4C97UUQMVIn6gkUG62ytQZU6Ycnz2fJD+qv5hEBBFvUGXxu GvB92lTrbtoW0HazMwlikk5k1wJBurT9UICEeNPGzssF66MmhayD4O+BE2TT7uLZeoTO YZ2EzZqgcOJgMed6SRlRi9eK6F6a8IkqdNQRzvmUuWyMz4Gnab7nzUa6Ldu5YmLVd5dM 0/oPGNEiXY7aKElkQ5KiPvKKnJpcgode0TzGokZ//2zX8ZUL+/P8qdeFqZjcM6JD4UG/ avD9tCWe9+pHfFNju5IM8rbWDmJ3XhBWKnpknoOdKlwSTI8ffB/GU/3I6LkaF5fzPxmQ Lu7w== X-Gm-Message-State: AFqh2koiejhBO0pWQnbghf3L/m9HrebytizSyBSlBeElRN5cRlmaOB89 iJUXxlTT65cnKW4zd/9E5vxkYIAWzn0= X-Google-Smtp-Source: AMrXdXvBO3XwDFEFP4aiabThnEvPyilT+MavJrQn1g/XNUjnHinI+8H+5i6icO8X00OXk8r6ftT1TA== X-Received: by 2002:a17:907:8b90:b0:84d:207d:c00c with SMTP id tb16-20020a1709078b9000b0084d207dc00cmr8882916ejc.25.1673212414365; Sun, 08 Jan 2023 13:13:34 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c485-2500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c485:2500::e63]) by smtp.googlemail.com with ESMTPSA id x25-20020a170906b09900b0080345493023sm2847997ejy.167.2023.01.08.13.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 13:13:33 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, pkshih@realtek.com, s.hauer@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v3 2/3] wifi: rtw88: Use rtw_iterate_vifs() for rtw_vif_watch_dog_iter() Date: Sun, 8 Jan 2023 22:13:23 +0100 Message-Id: <20230108211324.442823-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> References: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org USB and (upcoming) SDIO support may sleep in the read/write handlers. Make rtw_watch_dog_work() use rtw_iterate_vifs() to 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). Fixes: 78d5bf925f30 ("wifi: rtw88: iterate over vif/sta list non-atomically") Suggested-by: Ping-Ke Shih Reviewed-by: Ping-Ke Shih Tested-by: Sascha Hauer Signed-off-by: Martin Blumenstingl --- v1 -> v2: - no change v2 -> v3: - Added Ping-Ke's Reviewed-by (thank you!) - Added Sascha's Tested-by (thank you!) - added "wifi" prefix to the subject and reworded the title accordingly drivers/net/wireless/realtek/rtw88/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 888427cf3bdf..b2e78737bd5d 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -241,8 +241,10 @@ static void rtw_watch_dog_work(struct work_struct *work) rtw_phy_dynamic_mechanism(rtwdev); data.rtwdev = rtwdev; - /* use atomic version to avoid taking local->iflist_mtx mutex */ - rtw_iterate_vifs_atomic(rtwdev, rtw_vif_watch_dog_iter, &data); + /* rtw_iterate_vifs internally uses an atomic iterator which is needed + * to avoid taking local->iflist_mtx mutex + */ + rtw_iterate_vifs(rtwdev, rtw_vif_watch_dog_iter, &data); /* fw supports only one station associated to enter lps, if there are * more than two stations associated to the AP, then we can not enter From patchwork Sun Jan 8 21:13:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 13092733 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB839C54EBC for ; Sun, 8 Jan 2023 21:14:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234131AbjAHVOE (ORCPT ); Sun, 8 Jan 2023 16:14:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236309AbjAHVNh (ORCPT ); Sun, 8 Jan 2023 16:13:37 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09FC5DED8; Sun, 8 Jan 2023 13:13:37 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id tz12so15611065ejc.9; Sun, 08 Jan 2023 13:13:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W6iCeauKtAdV4BHRnRbqupjiQnftMeTdF0kVtH3hB+E=; b=G9lcAMCTgFzpB/3Dm9t/28beZyeu4Nte6d9/pPXfwO2I2wqHIopt9W+893yGZNEuNq pCMS7rORqej2jzzTQgup0eL9ELK4CGyo3T7Hyy6y6DP5irJYlcvUT6ywGOnDGA/Btm2w T/++gQMnez8Uz1dh+/G0uMIeZTp1ESuQJQarot7SIiq0KzQmJfszGjmbNrdN9mRV/shc hRhtSvaf9Fpspe6YvBVdV+07wk5aEA8HjbIy/GtPKB5ZMVPT1DRNLgpXYNW4WLXLU/t8 uor6zPu8ZZC9L/Aliv9+ux7KY3myaN28Xg3E09mG0SDbLQCM7Vc/T9DCZ5an3evdxc/V o7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W6iCeauKtAdV4BHRnRbqupjiQnftMeTdF0kVtH3hB+E=; b=GhRQlfF5INrn/NVsgryA2sof5D6/DJ0NOq3t5to3UWjpxI+U3wo+Ub11/gRFGQCGZc +GN+8F1jScCFGNU/TnhJRt833fkkT7TUeBeHMulNhTEJnEs9X2VEJDNWUytIZiyVNV6d ls0ZiYfE1MN2K5g6agVbIuJv5imkqpIoz4KWVp1sMGYRM4zxLOUPnc1dJ6uFiA5HQ48h GDu2bqKeOJMFrdtHMXDR+nzUu/Vx5k5UofB5iy0fIQLr8L3roOgOkP0ogtzggqhnYWjV z2c2OLL6bjcwGqE1re3XV+N1OauJpVFyC9uJjS7R7k//YX6cV35UjWxQVhx1y99ZhiH5 p7yw== X-Gm-Message-State: AFqh2krAgNkaUSLqmNQOY5Tn4TWM4iGZ26Aox36YibhZR1pwjgJfOTkW 1Bk0CvhEXdCVVu98FLxZtFpQN4lXmK4= X-Google-Smtp-Source: AMrXdXuMazg5jY6xTFm581wcDdAoeMxptf7hyehgj6rhH0L+UWBeBgT6q+wjdyQZNzmOgcG1+O4VLg== X-Received: by 2002:a17:907:d68e:b0:7c1:37:421c with SMTP id wf14-20020a170907d68e00b007c10037421cmr55961135ejc.32.1673212415338; Sun, 08 Jan 2023 13:13:35 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c485-2500-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c485:2500::e63]) by smtp.googlemail.com with ESMTPSA id x25-20020a170906b09900b0080345493023sm2847997ejy.167.2023.01.08.13.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Jan 2023 13:13:35 -0800 (PST) From: Martin Blumenstingl To: linux-wireless@vger.kernel.org Cc: tony0620emma@gmail.com, kvalo@kernel.org, pkshih@realtek.com, s.hauer@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v3 3/3] wifi: rtw88: Use non-atomic sta iterator in rtw_ra_mask_info_update() Date: Sun, 8 Jan 2023 22:13:24 +0100 Message-Id: <20230108211324.442823-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> References: <20230108211324.442823-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Ping-Ke Shih Tested-by: Sascha Hauer Signed-off-by: Martin Blumenstingl --- v1 -> v2: - Added Ping-Ke's Reviewed-by (thank you!) v2 -> v3: - Added Sascha's Tested-by (thank you!) - added "wifi" prefix to the subject and reworded the title accordingly 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; }