Commit 9ebacb1e authored by Po-Hao Huang's avatar Po-Hao Huang Committed by Kalle Valo

rtw88: pci: 8821c: Disable 21ce completion timeout

Disable this capability to avoid timeout errors on certain platforms.
Without it, pci bus might stuck and leads to disconnection.
Signed-off-by: default avatarPo-Hao Huang <phhuang@realtek.com>
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Tested-by: default avatarChris Chiu <chris.chiu@canonical.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220420093058.31646-2-pkshih@realtek.com
parent 9cbdadf0
...@@ -1482,12 +1482,15 @@ static void rtw_pci_interface_cfg(struct rtw_dev *rtwdev) ...@@ -1482,12 +1482,15 @@ static void rtw_pci_interface_cfg(struct rtw_dev *rtwdev)
static void rtw_pci_phy_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 rtw_chip_info *chip = rtwdev->chip;
struct pci_dev *pdev = rtwpci->pdev;
const struct rtw_intf_phy_para *para; const struct rtw_intf_phy_para *para;
u16 cut; u16 cut;
u16 value; u16 value;
u16 offset; u16 offset;
int i; int i;
int ret;
cut = BIT(0) << rtwdev->hal.cut_version; cut = BIT(0) << rtwdev->hal.cut_version;
...@@ -1520,6 +1523,15 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev) ...@@ -1520,6 +1523,15 @@ static void rtw_pci_phy_cfg(struct rtw_dev *rtwdev)
} }
rtw_pci_link_cfg(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) static int __maybe_unused rtw_pci_suspend(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment