[PATCH 1/1][SRU][J] rtw88: pci: 8821c: Disable 21ce completion timeout
Chris Chiu
chris.chiu at canonical.com
Tue Jul 5 14:18:12 UTC 2022
From: Po-Hao Huang <phhuang at realtek.com>
BugLink: https://bugs.launchpad.net/bugs/1969771
Disable this capability to avoid timeout errors on certain platforms.
Without it, pci bus might stuck and leads to disconnection.
Signed-off-by: Po-Hao Huang <phhuang at realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih at realtek.com>
Tested-by: Chris Chiu <chris.chiu at canonical.com>
Signed-off-by: Kalle Valo <kvalo at kernel.org>
Link: https://lore.kernel.org/r/20220420093058.31646-2-pkshih@realtek.com
(cherry picked from commit 9ebacb1e7e75f2a7a9745d42da7031d3a1741029)
Signed-off-by: Chris Chiu <chris.chiu at canonical.com>
---
drivers/net/wireless/realtek/rtw88/pci.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 70ca338ed180..d6aaca75516c 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -1478,12 +1478,15 @@ static void rtw_pci_interface_cfg(struct rtw_dev *rtwdev)
static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
{
+ struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
struct rtw_chip_info *chip = rtwdev->chip;
+ struct pci_dev *pdev = rtwpci->pdev;
const struct rtw_intf_phy_para *para;
u16 cut;
u16 value;
u16 offset;
int i;
+ int ret;
cut = BIT(0) << rtwdev->hal.cut_version;
@@ -1516,6 +1519,15 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
}
rtw_pci_link_cfg(rtwdev);
+
+ /* Disable 8821ce completion timeout by default */
+ if (chip->id == RTW_CHIP_TYPE_8821C) {
+ ret = pcie_capability_set_word(pdev, PCI_EXP_DEVCTL2,
+ PCI_EXP_DEVCTL2_COMP_TMOUT_DIS);
+ if (ret)
+ rtw_err(rtwdev, "failed to set PCI cap, ret = %d\n",
+ ret);
+ }
}
static int __maybe_unused rtw_pci_suspend(struct device *dev)
--
2.25.1
More information about the kernel-team
mailing list