Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3780798ybe; Mon, 16 Sep 2019 00:46:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMmIBwM7fxWCib3dKXHStIqCAJe8PogT/Nx04eOYPifeCY/fhXDC8iCBe0cpYQ5JXZGInr X-Received: by 2002:aa7:d38e:: with SMTP id x14mr666028edq.102.1568620007853; Mon, 16 Sep 2019 00:46:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568620007; cv=none; d=google.com; s=arc-20160816; b=vgvDpyC3DhhNs3lQkk6pAW+VthU5OOp/ntpx69ikXGUAJW4vkhwDhBm66W0VVw29u9 2XAxKdU5DJM9NKTPOUzywFtUv8JY7pean+9l51Ji8mUbj7Mjgp86dQU4s3a5HXlxhh99 9YsQ1bnFQfwyNGpZP3kek/QzqP0Bn5ZWeWF7BwbPDkVqBT6DJU8IfNrQcM7rK/KMDPVi XdkIJXOiDlGzqXWibI9vfaNcFoWiNBYD3k2+g0osYuUJnMkLJUyMX+wa5AhNlKjRlZjw 2nStcD9V+1+Z2ZLe7fZUKcznfJQSBjL+Nxs9QUUyLZdwEE5EFJErU1lQBNG9aej0JbEQ Y1rw== 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=9xIpJf8Yf6QOffs+1o6T5SxAAgIKFhWkxTMtM/quHF0=; b=xKv2hzh9ayVF/LkzsBPqeyiC5vlgunWy9iiyAd81yCHlsq5Z9253o3hAYJRjDVQOcP EfIFea1W/3MZHBXbgkfrK3HuDD+SFD3j4QLghHPQ2f5sYn6rZvqi30aX3N6ZJr00dgYq a9VihYS/bwNAnnSrWRFXUp34Zt7JFw2tlJCvsuHQ7S/UZlUXZ73BFbVzhhJt7M0KYJJn 4fTkfumBdfT7el+gd/I2A+tkXL5AaMzJcu/rQK9tc0cEvBw4//xZVJYxSPFVx3nhqq9z 6c8KUEg1s8c/GOC1OHsbikInmAnVudZ9pms/mjWM9vdhMir+00c+IDksPmBxDp1WObf2 kcLg== 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 q46si21225703eda.44.2019.09.16.00.46.23; Mon, 16 Sep 2019 00:46:47 -0700 (PDT) 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 S1730234AbfIPHD7 (ORCPT + 99 others); Mon, 16 Sep 2019 03:03:59 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:60338 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726922AbfIPHD7 (ORCPT ); Mon, 16 Sep 2019 03:03:59 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x8G73rS3029972, 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 x8G73rS3029972 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Sep 2019 15:03:53 +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; Mon, 16 Sep 2019 15:03:53 +0800 From: To: CC: , Subject: [PATCH 05/15] rtw88: pci: release tx skbs DMAed when stop Date: Mon, 16 Sep 2019 15:03:35 +0800 Message-ID: <1568617425-28062-6-git-send-email-yhchuang@realtek.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568617425-28062-1-git-send-email-yhchuang@realtek.com> References: <1568617425-28062-1-git-send-email-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: Yan-Hsuan Chuang Interrupt is disabled to stop PCI, which means the skbs queued for each TX ring will not be released via DMA interrupt. To avoid those skbs remained being left in the skb queue until PCI has been removed, driver needs to release skbs by itself. Signed-off-by: Yan-Hsuan Chuang --- drivers/net/wireless/realtek/rtw88/pci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index 3238161..509743c 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -500,6 +500,17 @@ static void rtw_pci_dma_reset(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci) rtwpci->rx_tag = 0; } +static void rtw_pci_dma_release(struct rtw_dev *rtwdev, struct rtw_pci *rtwpci) +{ + struct rtw_pci_tx_ring *tx_ring; + u8 queue; + + for (queue = 0; queue < RTK_MAX_TX_QUEUE_NUM; queue++) { + tx_ring = &rtwpci->tx_rings[queue]; + rtw_pci_free_tx_ring_skbs(rtwdev, tx_ring); + } +} + static int rtw_pci_start(struct rtw_dev *rtwdev) { struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv; @@ -521,6 +532,7 @@ static void rtw_pci_stop(struct rtw_dev *rtwdev) spin_lock_irqsave(&rtwpci->irq_lock, flags); rtw_pci_disable_interrupt(rtwdev, rtwpci); + rtw_pci_dma_release(rtwdev, rtwpci); spin_unlock_irqrestore(&rtwpci->irq_lock, flags); } -- 2.7.4