> Subject: Re: [PATCH 2/6] rtw88: pci: reset dma when reset pci trx ring > > On Thu, Nov 28, 2019 at 8:19 PM <yhchuang@xxxxxxxxxxx> wrote: > > > > From: Chin-Yen Lee <timlee@xxxxxxxxxxx> > > > > When pci trx ring is reset, hw dma setting should be reset together. > > Otherswise, the rx_tag of rx flow is not synchronous to hw. > > > > Signed-off-by: Chin-Yen Lee <timlee@xxxxxxxxxxx> > > Signed-off-by: Yan-Hsuan Chuang <yhchuang@xxxxxxxxxxx> > > --- > > drivers/net/wireless/realtek/rtw88/pci.c | 17 ++++++++++------- > > 1 file changed, 10 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/wireless/realtek/rtw88/pci.c > b/drivers/net/wireless/realtek/rtw88/pci.c > > index 068f1bec88e6..78971cefb948 100644 > > --- a/drivers/net/wireless/realtek/rtw88/pci.c > > +++ b/drivers/net/wireless/realtek/rtw88/pci.c > > @@ -486,13 +486,6 @@ static void rtw_pci_disable_interrupt(struct > rtw_dev *rtwdev, > > rtwpci->irq_enabled = false; > > } > > > > -static int rtw_pci_setup(struct rtw_dev *rtwdev) > > -{ > > - rtw_pci_reset_trx_ring(rtwdev); > > - > > - return 0; > > -} > > - > > static void rtw_pci_dma_reset(struct rtw_dev *rtwdev, struct rtw_pci > *rtwpci) > > { > > /* reset dma and rx tag */ > > @@ -501,6 +494,16 @@ static void rtw_pci_dma_reset(struct rtw_dev > *rtwdev, struct rtw_pci *rtwpci) > > rtwpci->rx_tag = 0; > > } > > > > +static int rtw_pci_setup(struct rtw_dev *rtwdev) > > +{ > > + struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; > > + > > + rtw_pci_reset_trx_ring(rtwdev); > > + rtw_pci_dma_reset(rtwdev, rtwpci); > > + > > + return 0; > > +} > > + > Just a little curious about that the rtw_pci_dma_reset() is already in > rtw_pci_start(), then is it really necessary to do it in _setup? Or > maybe the rtw_pci_dma_reset() in rtw_pci_start should be removed? > > Chris > Yes, it looks redundant, can be removed. Thanks. Yan Hsuan