Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1683773ybl; Thu, 19 Dec 2019 00:59:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyJNANU6WXq6Nghpg2IENeOaqmAP0pGW270iP5qsv/CBlKMpbVtYdYyCmuDDuHo5vhlKsu7 X-Received: by 2002:a05:6830:1149:: with SMTP id x9mr7942568otq.156.1576745948780; Thu, 19 Dec 2019 00:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576745948; cv=none; d=google.com; s=arc-20160816; b=yb7tXUnK3PAQcsiEeY4qa2S+swp6sq4XAbH93eB7qosqmwBai32CTgdsbPIgoNquKn g7DNgYky60YIXXdDkIRif7QTK8JLG4tUS73bSmjRzsJ+GeqaRhRJMDauomjDH+dnptQC j66jtkf/fFkqZaFEUKITM4v5aG/jD3lUpwRmVSEv36iaW4XoNKmL4KaYWIMdXXh54LAg GKY4RuL6mp2kCrJfqxfapMeHv6Xjg8P3HScdA170xr8AcDWgssuunXGPkivk7avIxeAO u423SNTH0MJxS1FsGrDzbCcalyqWHel/KQZemCUoD9W6IFO9bP/S52OhJgV9n0OxPKq3 U4Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:authenticated-by; bh=yBK+YWtz7cQdO6iF0/kmP2LkFbYERGqNNs92u97Tpfo=; b=NikU4TguaV2GkB+I4Db4vpUfjwds+6ZpgSgORqr2TgMbMfiClg15tGteJytz+IEyae 3Kl79AsoKKZdNXFLz6WrEiBT+ptJK1hDr9TuAFbANQU1cRB4MkdZQx5PbGDUttiw/l5S riABZ4t4kGAHF9EbrtmwTDnxDsTMdT2LpK3zqlvlR4XcLuYzSQIhDaWi0qfLcIy26XJN uEoXmhhZj67OnFoKl3IumXdJWPzuSigwWSAyYBmWnnoPNQRXK1y01CsHIIy+0gokcxd5 FHy6f1sXtXPWThzx7oldGp5YbERj96/56e4XWJDDALJNjnKFvO4/g6QKkAaklUw8lKzh HKBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si2898352oik.171.2019.12.19.00.58.47; Thu, 19 Dec 2019 00:59:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726699AbfLSI6l (ORCPT + 99 others); Thu, 19 Dec 2019 03:58:41 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:59556 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbfLSI6l (ORCPT ); Thu, 19 Dec 2019 03:58:41 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID xBJ8wXCf024862, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV01.realtek.com.tw[172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id xBJ8wXCf024862 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Dec 2019 16:58:33 +0800 Received: from localhost.localdomain (172.21.68.126) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.468.0; Thu, 19 Dec 2019 16:58:32 +0800 From: To: CC: , , Subject: [PATCH v4 2/7] rtw88: pci: reset dma when reset pci trx ring Date: Thu, 19 Dec 2019 16:58:11 +0800 Message-ID: <20191219085816.20709-3-yhchuang@realtek.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191219085816.20709-1-yhchuang@realtek.com> References: <20191219085816.20709-1-yhchuang@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.68.126] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Chin-Yen Lee 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 Signed-off-by: Yan-Hsuan Chuang Reviewed-by: Chris Chiu --- v1 -> v2 * remove duplicated rtw_pci_dma_reset() v2 -> v3 * no change v3 -> v4 * no change 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