Skip to content

Commit 0a78bb6

Browse files
Ping-Ke ShihKalle Valo
authored andcommitted
wifi: rtw89: pci: update interrupt mitigation register for 8922AE
To reduce interrupts, configure the mitigation setting of 8922AE when bringing interface up, and then check situations to decide turning on or off the function. With this, interrupt count decreases to 20,141 from 202,141 in period of 20 seconds. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9f08c77 commit 0a78bb6

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

drivers/net/wireless/realtek/rtw89/pci.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,19 +3620,26 @@ static void rtw89_pci_aspm_set(struct rtw89_dev *rtwdev, bool enable)
36203620

36213621
static void rtw89_pci_recalc_int_mit(struct rtw89_dev *rtwdev)
36223622
{
3623+
enum rtw89_chip_gen chip_gen = rtwdev->chip->chip_gen;
36233624
const struct rtw89_pci_info *info = rtwdev->pci_info;
36243625
struct rtw89_traffic_stats *stats = &rtwdev->stats;
36253626
enum rtw89_tfc_lv tx_tfc_lv = stats->tx_tfc_lv;
36263627
enum rtw89_tfc_lv rx_tfc_lv = stats->rx_tfc_lv;
36273628
u32 val = 0;
36283629

3629-
if (!rtwdev->scanning &&
3630-
(tx_tfc_lv >= RTW89_TFC_HIGH || rx_tfc_lv >= RTW89_TFC_HIGH))
3630+
if (rtwdev->scanning ||
3631+
(tx_tfc_lv < RTW89_TFC_HIGH && rx_tfc_lv < RTW89_TFC_HIGH))
3632+
goto out;
3633+
3634+
if (chip_gen == RTW89_CHIP_BE)
3635+
val = B_BE_PCIE_MIT_RX0P2_EN | B_BE_PCIE_MIT_RX0P1_EN;
3636+
else
36313637
val = B_AX_RXMIT_RXP2_SEL | B_AX_RXMIT_RXP1_SEL |
36323638
FIELD_PREP(B_AX_RXCOUNTER_MATCH_MASK, RTW89_PCI_RXBD_NUM_MAX / 2) |
36333639
FIELD_PREP(B_AX_RXTIMER_UNIT_MASK, AX_RXTIMER_UNIT_64US) |
36343640
FIELD_PREP(B_AX_RXTIMER_MATCH_MASK, 2048 / 64);
36353641

3642+
out:
36363643
rtw89_write32(rtwdev, info->mit_addr, val);
36373644
}
36383645

drivers/net/wireless/realtek/rtw89/rtw8922ae.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const struct rtw89_pci_info rtw8922a_pci_info = {
4343

4444
.rpwm_addr = R_BE_PCIE_HRPWM,
4545
.cpwm_addr = R_BE_PCIE_CRPWM,
46+
.mit_addr = R_BE_PCIE_MIT_CH_EN,
4647
.tx_dma_ch_mask = 0,
4748
.bd_idx_addr_low_power = NULL,
4849
.dma_addr_set = &rtw89_pci_ch_dma_addr_set_be,

0 commit comments

Comments
 (0)