]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
rtw88: pci: reset H2C queue indexes in a single write
authorYan-Hsuan Chuang <yhchuang@realtek.com>
Wed, 2 Oct 2019 02:31:18 +0000 (10:31 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 2 Oct 2019 04:33:40 +0000 (07:33 +0300)
If the driver doesn't reset the host's and device's indexes
in a single write, the indexes will become different in a
short period. And it will confuse the DMA engine, make it
start to process non-existed entries.

Better to Write-1-to-reset the indexes, for the DMA engine
to know that this is a reset of the H2C queue, not a kick
off.

Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtw88/pci.c

index d90928be663b910c3d5cb88f54a7e5f2fe4d6d17..509743cfd70a6f9f524d8aee5f49ca0c0eef3b58 100644 (file)
@@ -457,9 +457,9 @@ static void rtw_pci_reset_buf_desc(struct rtw_dev *rtwdev)
        /* reset read/write point */
        rtw_write32(rtwdev, RTK_PCI_TXBD_RWPTR_CLR, 0xffffffff);
 
-       /* rest H2C Queue index */
-       rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HOST_IDX);
-       rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR, BIT_CLR_H2CQ_HW_IDX);
+       /* reset H2C Queue index in a single write */
+       rtw_write32_set(rtwdev, RTK_PCI_TXBD_H2CQ_CSR,
+                       BIT_CLR_H2CQ_HOST_IDX | BIT_CLR_H2CQ_HW_IDX);
 }
 
 static void rtw_pci_reset_trx_ring(struct rtw_dev *rtwdev)