Skip to content

Commit baaf806

Browse files
Chih-Kang ChangPing-Ke Shih
authored andcommitted
wifi: rtw89: wow: refine WoWLAN flows of HCI interrupts and low power mode
After enabling packet offload, the TX will be stuck after resume from WoWLAN mode. And the 8852c gets error messages like rtw89_8852ce 0000:04:00.0: No busy txwd pages available rtw89_8852ce 0000:04:00.0: queue 0 txwd 100 is not idle rtw89_8852ce 0000:04:00.0: queue 0 txwd 101 is not idle rtw89_8852ce 0000:04:00.0: queue 0 txwd 102 is not idle rtw89_8852ce 0000:04:00.0: queue 0 txwd 103 is not idle If suspend/resume many times that firmware will download failed and disconnection. To fix these issues, We removed the rtw89_hci_disable_intr() and rtw89_hci_enable_intr() during rtw89_wow_swap_fw() to prevent add packet offload can't receive c2h back due to interrupt disable. Only 8852C and 8922A needs to disable interrupt before downloading fw. Furthermore, we avoid using low power HCI mode on WoWLAN mode, to prevent interrupt enabled, then get interrupt and calculate RXBD mismatched due to software RXBD index already reset but hardware RXBD index not yet. Fixes: 5c12bb6 ("wifi: rtw89: refine packet offload flow") Signed-off-by: Chih-Kang Chang <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
1 parent a79264e commit baaf806

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

drivers/net/wireless/realtek/rtw89/ps.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ static void rtw89_ps_power_mode_change_with_hci(struct rtw89_dev *rtwdev,
5555

5656
static void rtw89_ps_power_mode_change(struct rtw89_dev *rtwdev, bool enter)
5757
{
58-
if (rtwdev->chip->low_power_hci_modes & BIT(rtwdev->ps_mode))
58+
if (rtwdev->chip->low_power_hci_modes & BIT(rtwdev->ps_mode) &&
59+
!test_bit(RTW89_FLAG_WOWLAN, rtwdev->flags))
5960
rtw89_ps_power_mode_change_with_hci(rtwdev, enter);
6061
else
6162
rtw89_mac_power_mode_change(rtwdev, enter);

drivers/net/wireless/realtek/rtw89/wow.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,27 +458,36 @@ static int rtw89_wow_swap_fw(struct rtw89_dev *rtwdev, bool wow)
458458
struct rtw89_wow_param *rtw_wow = &rtwdev->wow;
459459
struct ieee80211_vif *wow_vif = rtw_wow->wow_vif;
460460
struct rtw89_vif *rtwvif = (struct rtw89_vif *)wow_vif->drv_priv;
461+
enum rtw89_core_chip_id chip_id = rtwdev->chip->chip_id;
461462
const struct rtw89_chip_info *chip = rtwdev->chip;
462463
bool include_bb = !!chip->bbmcu_nr;
464+
bool disable_intr_for_dlfw = false;
463465
struct ieee80211_sta *wow_sta;
464466
struct rtw89_sta *rtwsta = NULL;
465467
bool is_conn = true;
466468
int ret;
467469

468-
rtw89_hci_disable_intr(rtwdev);
470+
if (chip_id == RTL8852C || chip_id == RTL8922A)
471+
disable_intr_for_dlfw = true;
469472

470473
wow_sta = ieee80211_find_sta(wow_vif, rtwvif->bssid);
471474
if (wow_sta)
472475
rtwsta = (struct rtw89_sta *)wow_sta->drv_priv;
473476
else
474477
is_conn = false;
475478

479+
if (disable_intr_for_dlfw)
480+
rtw89_hci_disable_intr(rtwdev);
481+
476482
ret = rtw89_fw_download(rtwdev, fw_type, include_bb);
477483
if (ret) {
478484
rtw89_warn(rtwdev, "download fw failed\n");
479485
return ret;
480486
}
481487

488+
if (disable_intr_for_dlfw)
489+
rtw89_hci_enable_intr(rtwdev);
490+
482491
rtw89_phy_init_rf_reg(rtwdev, true);
483492

484493
ret = rtw89_fw_h2c_role_maintain(rtwdev, rtwvif, rtwsta,
@@ -524,7 +533,6 @@ static int rtw89_wow_swap_fw(struct rtw89_dev *rtwdev, bool wow)
524533
rtw89_phy_rfk_pre_ntfy_and_wait(rtwdev, RTW89_PHY_0, 5);
525534

526535
rtw89_mac_hw_mgnt_sec(rtwdev, wow);
527-
rtw89_hci_enable_intr(rtwdev);
528536

529537
return 0;
530538
}

0 commit comments

Comments
 (0)