diff mbox series

[1/4] wifi: rtw89: pci: update SER timer unit and timeout time

Message ID 20240121071826.10159-2-pkshih@realtek.com (mailing list archive)
State Accepted
Commit 57b9426952c46f8d0aa7fad27fe55403fb28974f
Delegated to: Kalle Valo
Headers show
Series wifi: rtw89: pci: refine PCI SER, RX tag and RX DMA buffer size | expand

Commit Message

Ping-Ke Shih Jan. 21, 2024, 7:18 a.m. UTC
Be higher resolution of SER timer unit from 32ms to 16ms to detect
abnormal situation more accurately, and set hardware watchdog timer to 4ms.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/pci_be.c | 5 +++++
 drivers/net/wireless/realtek/rtw89/reg.h    | 3 +++
 2 files changed, 8 insertions(+)

Comments

Kalle Valo Feb. 1, 2024, 10:18 a.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> wrote:

> Be higher resolution of SER timer unit from 32ms to 16ms to detect
> abnormal situation more accurately, and set hardware watchdog timer to 4ms.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

4 patches applied to wireless-next.git, thanks.

57b9426952c4 wifi: rtw89: pci: update SER timer unit and timeout time
26cdaee43dc5 wifi: rtw89: pci: interrupt v2 refine IMR for SER
0bc7d1d4e63c wifi: rtw89: pci: validate RX tag for RXQ and RPQ
c108b4a50dd7 wifi: rtw89: pci: enlarge RX DMA buffer to consider size of RX descriptor
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/pci_be.c b/drivers/net/wireless/realtek/rtw89/pci_be.c
index 629ffa4bee91..5c9e39357773 100644
--- a/drivers/net/wireless/realtek/rtw89/pci_be.c
+++ b/drivers/net/wireless/realtek/rtw89/pci_be.c
@@ -105,6 +105,10 @@  static void rtw89_pci_ctrl_trxdma_pcie_be(struct rtw89_dev *rtwdev,
 		val |= B_BE_STOP_AXI_MST;
 
 	rtw89_write32(rtwdev, R_BE_HAXI_INIT_CFG1, val);
+
+	if (io_en == MAC_AX_PCIE_ENABLE)
+		rtw89_write32_mask(rtwdev, R_BE_HAXI_MST_WDT_TIMEOUT_SEL_V1,
+				   B_BE_HAXI_MST_WDT_TIMEOUT_SEL_MASK, 4);
 }
 
 static void rtw89_pci_clr_idx_all_be(struct rtw89_dev *rtwdev)
@@ -257,6 +261,7 @@  static void rtw89_pci_ser_setting_be(struct rtw89_dev *rtwdev)
 	rtw89_write32(rtwdev, R_BE_PL1_DBG_INFO, 0x0);
 	rtw89_write32_set(rtwdev, R_BE_FWS1IMR, B_BE_PCIE_SER_TIMEOUT_INDIC_EN);
 	rtw89_write32_set(rtwdev, R_BE_SER_PL1_CTRL, B_BE_PL1_SER_PL1_EN);
+	rtw89_write32_mask(rtwdev, R_BE_SER_PL1_CTRL, B_BE_PL1_TIMER_UNIT_MASK, 1);
 
 	val32 = rtw89_read32(rtwdev, R_BE_REG_PL1_MASK);
 	val32 |= B_BE_SER_PMU_IMR | B_BE_SER_L1SUB_IMR | B_BE_SER_PM_MASTER_IMR |
diff --git a/drivers/net/wireless/realtek/rtw89/reg.h b/drivers/net/wireless/realtek/rtw89/reg.h
index b411bf726849..e1802fe04576 100644
--- a/drivers/net/wireless/realtek/rtw89/reg.h
+++ b/drivers/net/wireless/realtek/rtw89/reg.h
@@ -5727,6 +5727,9 @@ 
 #define B_BE_STOP_CH1 BIT(1)
 #define B_BE_STOP_CH0 BIT(0)
 
+#define R_BE_HAXI_MST_WDT_TIMEOUT_SEL_V1 0xB02C
+#define B_BE_HAXI_MST_WDT_TIMEOUT_SEL_MASK GENMASK(4, 0)
+
 #define R_BE_HAXI_IDCT_MSK 0xB0B8
 #define B_BE_HAXI_RRESP_ERR_IDCT_MSK BIT(7)
 #define B_BE_HAXI_BRESP_ERR_IDCT_MSK BIT(6)