rtw88: pci: turn off PCI ASPM during NAPI polling
Subsystems (3)
PATCH 1/1 rtw88: pci: turn off PCI ASPM during NAPI polling
The system on the machines equipped with RTL8821CE freezes randomly until the PCI ASPM is disabled during NAPI poll function.
--- drivers/net/wireless/realtek/rtw88/pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/realtek/rtw88/pci.c +2 -0
@@ -1658,6 +1658,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget) priv);int work_done =0 ; +rtw_pci_link_ps (rtwdev, false);while (work_done < budget) {u32 work_done_once;
@@ -1681,6 +1682,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget)if (rtw_pci_get_hw_rx_ring_nr (rtwdev, rtwpci))napi_schedule (napi); } +rtw_pci_link_ps (rtwdev, true);return work_done; }
Signature · 1 line
2.34.1
Pkshih
maintainerQuoted 34 lines
-----Original Message-----
From: Jian-Hong Pan <[email protected]>
Sent: Monday, December 13, 2021 4:09 PM
To: Pkshih <[email protected]>; Bernie Huang <[email protected]>; Kai-Heng Feng <[email protected]>; Yan-Hsuan Chuang <[email protected]>; Kalle Valo <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jian-Hong Pan <[email protected]>
Subject: [PATCH] rtw88: pci: turn off PCI ASPM during NAPI pollingThe system on the machines equipped with RTL8821CE freezes randomly until the PCI ASPM is disabled during NAPI poll function.
Fixes 9e2fd29864c5 ("rtw88: add napi support")Signed-off-by Jian-Hong Pan <[email protected]>--- drivers/net/wireless/realtek/rtw88/pci.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/wireless/realtek/rtw88/pci.c +1
-0@@ -1658,6 +1658,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget) priv);int work_done =0 ; +rtw_pci_link_ps (rtwdev, false);while (work_done < budget) {u32 work_done_once;
drivers/net/wireless/realtek/rtw88/pci.c static int rtw_pci_napi_poll(struct napi_struct *napi, int budget) · line 1688
Quoted 7 lines
drivers/net/wireless/realtek/rtw88/pci.c +1
-0@@ -1681,6 +1682,7 @@ static int rtw_pci_napi_poll(struct napi_struct *napi, int budget)if (rtw_pci_get_hw_rx_ring_nr (rtwdev, rtwpci))napi_schedule (napi); } +rtw_pci_link_ps (rtwdev, true);return work_done; }
I think we need to add ref_cnt and only do this thing on specific chip and platform [1].
--
Ping-Ke