]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: pci: no need to wait CLK ready for RTL8922DE
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 24 Apr 2026 07:25:50 +0000 (15:25 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Wed, 29 Apr 2026 05:44:23 +0000 (13:44 +0800)
The bit is to wait for CLK ready when entering PCIE L1SS. However, a
certain host might not enable CLK for a situation, causing device state
stuck and trigger PCIE SER. Unset this bit as default like earlier chips.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20260424072552.59220-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/pci.h
drivers/net/wireless/realtek/rtw89/pci_be.c

index e7da37b9da7d90773a509ac9305c1be2257663e0..d0d1e2b996980fb3f92b7c5664e55a6b481518c8 100644 (file)
@@ -33,6 +33,8 @@
 #define RAC_REG_REV2                   0x1B
 #define BAC_CMU_EN_DLY_MASK            GENMASK(15, 12)
 #define PCIE_DPHY_DLY_25US             0x1
+#define RAC_ANA14                      0x14
+#define EIEOS_L1SS_WAIT_CLKRDY         BIT(2)
 #define RAC_ANA19                      0x19
 #define B_PCIE_BIT_RD_SEL              BIT(2)
 #define RAC_REG_FLD_0                  0x1D
index dfffec1ff3c78ea6ec44b8c6aba882b0e0860d5b..473d491eb3f41e0d89da447b106425e0cb5d53b6 100644 (file)
@@ -83,6 +83,17 @@ static void _patch_pcie_power_wake_be(struct rtw89_dev *rtwdev, bool power_up)
                rtw89_write32_clr(rtwdev, R_BE_HCI_OPT_CTRL, BIT_WAKE_CTRL_V1);
 }
 
+static void _patch_pre_init_be(struct rtw89_dev *rtwdev)
+{
+       struct rtw89_hal *hal = &rtwdev->hal;
+
+       if (!(rtwdev->chip->chip_id == RTL8922D && hal->cid == RTL8922D_CID7090))
+               return;
+
+       rtw89_write16_clr(rtwdev, R_RAC_DIRECT_OFFSET_BE_LANE0_G2 +
+                                 RAC_ANA14 * RAC_MULT, EIEOS_L1SS_WAIT_CLKRDY);
+}
+
 static void rtw89_pci_set_io_rcy_be(struct rtw89_dev *rtwdev)
 {
        const struct rtw89_pci_info *info = rtwdev->pci_info;
@@ -475,6 +486,7 @@ static int rtw89_pci_ops_mac_pre_init_be(struct rtw89_dev *rtwdev)
 
        rtw89_pci_set_io_rcy_be(rtwdev);
        _patch_pcie_power_wake_be(rtwdev, true);
+       _patch_pre_init_be(rtwdev);
        rtw89_pci_ctrl_wpdma_pcie_be(rtwdev, false);
        rtw89_pci_ctrl_trxdma_pcie_be(rtwdev, MAC_AX_PCIE_DISABLE,
                                      MAC_AX_PCIE_DISABLE, MAC_AX_PCIE_DISABLE);