Search Linux Wireless

Re: [PATCH v2 2/6] rtw88: pci: reset dma when reset pci trx ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 9, 2019 at 3:21 PM <yhchuang@xxxxxxxxxxx> wrote:
>
> From: Chin-Yen Lee <timlee@xxxxxxxxxxx>
>
> When PCI trx rings are reset, the DMA engine should also be reset.
> Otherswise, the rx_tag of rx flow is not synchronous to hw.
>
> Remove DMA reset when rtw_pci_start() as we added it in
> rtw_pci_setup().
>
> Signed-off-by: Chin-Yen Lee <timlee@xxxxxxxxxxx>
> Signed-off-by: Yan-Hsuan Chuang <yhchuang@xxxxxxxxxxx>
> ---
Reviewed-by: Chris Chiu <chiu@xxxxxxxxxxxx>
>
> v1 -> v2
>  * remove duplicated rtw_pci_dma_reset()
>
>  drivers/net/wireless/realtek/rtw88/pci.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
> index 068f1bec88e6..c394df494c95 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;
> +}
> +
>  static void rtw_pci_dma_release(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci)
>  {
>         struct rtw_pci_tx_ring *tx_ring;
> @@ -518,8 +521,6 @@ static int rtw_pci_start(struct rtw_dev *rtwdev)
>         struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
>         unsigned long flags;
>
> -       rtw_pci_dma_reset(rtwdev, rtwpci);
> -
>         spin_lock_irqsave(&rtwpci->irq_lock, flags);
>         rtw_pci_enable_interrupt(rtwdev, rtwpci);
>         spin_unlock_irqrestore(&rtwpci->irq_lock, flags);
> --
> 2.17.1
>



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux