From: Marcin Ślusarz <mslusarz@xxxxxxxxx> This chip fails to reliably wake up from power off. After some number of power off+on cycles, it stops with endless spamming of: rtw_8821cu 1-1:1.2: rtw_usb_reg_sec: reg 0x4e0, usb write 1 fail, status: -71 killing both Wifi and Bluetooth part of the device. On arm, just leaving the wifi device unconfigured kills it in up to 20 minutes. If I keep restarting wpa_supplicant I can trigger it within a minute. Looping "ifconfig wlan0 down; ifconfig wlan0 up" also triggers it within a minute. On x86_64 system the only way I could trigger this was via ifconfig loop, but it took 3 hours and 20 minutes to do it. The only thing that "fixes" the device is replugging it. Signed-off-by: Marcin Ślusarz <mslusarz@xxxxxxxxx> Cc: Ping-Ke Shih <pkshih@xxxxxxxxxxx> Cc: Larry Finger <Larry.Finger@xxxxxxxxxxxx> Cc: Kalle Valo <kvalo@xxxxxxxxxx> Cc: linux-wireless@xxxxxxxxxxxxxxx --- drivers/net/wireless/realtek/rtw88/main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c index 7ab7a988b123..e8bfa683d7bb 100644 --- a/drivers/net/wireless/realtek/rtw88/main.c +++ b/drivers/net/wireless/realtek/rtw88/main.c @@ -1482,11 +1482,11 @@ void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, int rtw_core_start(struct rtw_dev *rtwdev) { - int ret; - - ret = rtw_power_on(rtwdev); - if (ret) - return ret; + if (!test_bit(RTW_FLAG_POWERON, rtwdev->flags)) { + int ret = rtw_power_on(rtwdev); + if (ret) + return ret; + } rtw_sec_enable_sec_engine(rtwdev); @@ -1534,7 +1534,9 @@ void rtw_core_stop(struct rtw_dev *rtwdev) mutex_lock(&rtwdev->mutex); - rtw_power_off(rtwdev); + /* FIXME: 8821C doesn't wake up from this state from time to time */ + if (rtwdev->chip->id != RTW_CHIP_TYPE_8821C) + rtw_power_off(rtwdev); } static void rtw_init_ht_cap(struct rtw_dev *rtwdev, -- 2.25.1