]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
rtw88: fix RX clock gate setting while fifo dump
authorZong-Zhe Yang <kevin_yang@realtek.com>
Mon, 27 Sep 2021 11:18:30 +0000 (19:18 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 5 Oct 2021 05:27:48 +0000 (08:27 +0300)
When fw fifo dumps, RX clock gating should be disabled to avoid
something unexpected. However, the register operation ran into
a mistake. So, we fix it.

Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210927111830.5354-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/fw.c
drivers/net/wireless/realtek/rtw88/reg.h

index ccd8221ab264f6a5a40890bdeae9a5444c0bec64..0c4f2a2f2d7fb47d3c71664f898aabec794bfdb4 100644 (file)
@@ -1582,12 +1582,10 @@ static void rtw_fw_read_fifo_page(struct rtw_dev *rtwdev, u32 offset, u32 size,
        u32 i;
        u16 idx = 0;
        u16 ctl;
-       u8 rcr;
 
-       rcr = rtw_read8(rtwdev, REG_RCR + 2);
        ctl = rtw_read16(rtwdev, REG_PKTBUF_DBG_CTRL) & 0xf000;
        /* disable rx clock gate */
-       rtw_write8(rtwdev, REG_RCR, rcr | BIT(3));
+       rtw_write32_set(rtwdev, REG_RCR, BIT_DISGCLK);
 
        do {
                rtw_write16(rtwdev, REG_PKTBUF_DBG_CTRL, start_pg | ctl);
@@ -1606,7 +1604,8 @@ static void rtw_fw_read_fifo_page(struct rtw_dev *rtwdev, u32 offset, u32 size,
 
 out:
        rtw_write16(rtwdev, REG_PKTBUF_DBG_CTRL, ctl);
-       rtw_write8(rtwdev, REG_RCR + 2, rcr);
+       /* restore rx clock gate */
+       rtw_write32_clr(rtwdev, REG_RCR, BIT_DISGCLK);
 }
 
 static void rtw_fw_read_fifo(struct rtw_dev *rtwdev, enum rtw_fw_fifo_sel sel,
index abb7b490d8faf40d708c5d2c306de4c04495323b..84ba9ec489c370521dd093eff4cc6a67e3960e83 100644 (file)
 #define BIT_MFBEN              BIT(22)
 #define BIT_DISCHKPPDLLEN      BIT(21)
 #define BIT_PKTCTL_DLEN                BIT(20)
+#define BIT_DISGCLK            BIT(19)
 #define BIT_TIM_PARSER_EN      BIT(18)
 #define BIT_BC_MD_EN           BIT(17)
 #define BIT_UC_MD_EN           BIT(16)