summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtw89/mac.c
diff options
context:
space:
mode:
authorPing-Ke Shih <pkshih@realtek.com>2022-11-17 11:52:35 +0300
committerKalle Valo <kvalo@kernel.org>2022-11-22 13:15:56 +0300
commitac3a9f1838d8f5e5f9c8b6e2582b65c48a1e7bc1 (patch)
treef7992c03962b2e19af6909e8fe854a5806bf3898 /drivers/net/wireless/realtek/rtw89/mac.c
parent29136c95fdc5d9bbfb56131408388fefdba4ed95 (diff)
downloadlinux-ac3a9f1838d8f5e5f9c8b6e2582b65c48a1e7bc1.tar.xz
wifi: rtw89: avoid inaccessible IO operations during doing change_interface()
During doing change_interface(), hardware is power-off, so some components are inaccessible and return error. This causes things unexpected, and we don't have a warning message for that. So, ignore some IO operations in this situation, and add a warning message to indicate something wrong. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221117085235.53777-1-pkshih@realtek.com
Diffstat (limited to 'drivers/net/wireless/realtek/rtw89/mac.c')
-rw-r--r--drivers/net/wireless/realtek/rtw89/mac.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index ecd603a88134..6587cdf6ba62 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -3600,6 +3600,13 @@ int rtw89_mac_set_macid_pause(struct rtw89_dev *rtwdev, u8 macid, bool pause)
u8 grp = macid >> 5;
int ret;
+ /* If this is called by change_interface() in the case of P2P, it could
+ * be power-off, so ignore this operation.
+ */
+ if (test_bit(RTW89_FLAG_CHANGING_INTERFACE, rtwdev->flags) &&
+ !test_bit(RTW89_FLAG_POWERON, rtwdev->flags))
+ return 0;
+
ret = rtw89_mac_check_mac_en(rtwdev, RTW89_MAC_0, RTW89_CMAC_SEL);
if (ret)
return ret;