Skip to contentSkip to conversation

wifi: rtw89: pci: disable PCI completion timeout control

PATCH In review Ping-Ke Shih 1 participant 2 messages Dec 25, 2024 – Jan 7, 2025 Realtek wireless driver (rtw89)

lore
Share & tools
lore

Ping-Ke Shih

author maintainer
#0 lore raw

PATCH 1/1 wifi: rtw89: pci: disable PCI completion timeout control

From: Chin-Yen Lee <[email protected]>

Realtek's chips follow suggestion of PCIe spec to design the max timeout of PCI completion, but some PCIe host reply too slow to meet it and lead PCI AER. Disable PCI completion timeout function via PCI configuration to avoid the AER.

---
 drivers/net/wireless/realtek/rtw89/pci.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/net/wireless/realtek/rtw89/pci.c +10 -0
index c3a027735d0f..516160147191 100644
@@ -4078,6 +4078,15 @@ static void rtw89_pci_l1ss_cfg(struct rtw89_dev *rtwdev)
 		rtw89_pci_l1ss_set(rtwdev, true);
 }
 
+static void rtw89_pci_cpl_timeout_cfg(struct rtw89_dev *rtwdev)
+{
+	struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
+	struct pci_dev *pdev = rtwpci->pdev;
+
+	pcie_capability_set_word(pdev, PCI_EXP_DEVCTL2,
+				 PCI_EXP_DEVCTL2_COMP_TMOUT_DIS);
+}
+
 static int rtw89_pci_poll_io_idle_ax(struct rtw89_dev *rtwdev)
 {
 	int ret = 0;
@@ -4291,6 +4300,7 @@ void rtw89_pci_basic_cfg(struct rtw89_dev *rtwdev, bool resume)
 
 	rtw89_pci_disable_eq(rtwdev);
 	rtw89_pci_filter_out(rtwdev);
+	rtw89_pci_cpl_timeout_cfg(rtwdev);
 	rtw89_pci_link_cfg(rtwdev);
 	rtw89_pci_l1ss_cfg(rtwdev);
 }
Signature · 1 line
2.25.1
author maintainer
#1 lore raw
Quoted 9 lines · Ping-Ke Shih

From: Chin-Yen Lee <[email protected]>

Realtek's chips follow suggestion of PCIe spec to design the max timeout of PCI completion, but some PCIe host reply too slow to meet it and lead PCI AER. Disable PCI completion timeout function via PCI configuration to avoid the AER.

1 patch(es) applied to rtw-next branch of rtw.git, thanks.

f69ccbc50a12 wifi: rtw89: pci: disable PCI completion timeout control

---
https://github.com/pkshih/rtw.git