]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtl8xxxu: fix RTL8723BU connection failure issue after warm reboot
authorChris Chiu <chiu@endlessm.com>
Wed, 16 Oct 2019 01:54:08 +0000 (09:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 31 Dec 2019 15:44:14 +0000 (16:44 +0100)
[ Upstream commit 0eeb91ade90ce06d2fa1e2fcb55e3316b64c203c ]

The RTL8723BU has problems connecting to AP after each warm reboot.
Sometimes it returns no scan result, and in most cases, it fails
the authentication for unknown reason. However, it works totally
fine after cold reboot.

Compare the value of register SYS_CR and SYS_CLK_MAC_CLK_ENABLE
for cold reboot and warm reboot, the registers imply that the MAC
is already powered and thus some procedures are skipped during
driver initialization. Double checked the vendor driver, it reads
the SYS_CR and SYS_CLK_MAC_CLK_ENABLE also but doesn't skip any
during initialization based on them. This commit only tells the
RTL8723BU to do full initialization without checking MAC status.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

index ade057d868f7e5645002576d4482a1967eb41c9b..5e9ce03067de28e83b794bbd7af3efe592cee472 100644 (file)
@@ -1341,6 +1341,7 @@ struct rtl8xxxu_fileops {
        u8 has_s0s1:1;
        u8 has_tx_report:1;
        u8 gen2_thermal_meter:1;
+       u8 needs_full_init:1;
        u32 adda_1t_init;
        u32 adda_1t_path_on;
        u32 adda_2t_path_on_a;
index ceffe05bd65b2bd4f47fa83527bd39868c39349b..f3cd314d1a9cfd319807bb76737cc4cda886d577 100644 (file)
@@ -1670,6 +1670,7 @@ struct rtl8xxxu_fileops rtl8723bu_fops = {
        .has_s0s1 = 1,
        .has_tx_report = 1,
        .gen2_thermal_meter = 1,
+       .needs_full_init = 1,
        .adda_1t_init = 0x01c00014,
        .adda_1t_path_on = 0x01c00014,
        .adda_2t_path_on_a = 0x01c00014,
index c6c41fb962ffcab7c920840cf22deb023279eb93..361248e9756879991ad806e29b5a7376be833413 100644 (file)
@@ -3902,6 +3902,9 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
        else
                macpower = true;
 
+       if (fops->needs_full_init)
+               macpower = false;
+
        ret = fops->power_on(priv);
        if (ret < 0) {
                dev_warn(dev, "%s: Failed power on\n", __func__);