Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3007060pxb; Tue, 13 Apr 2021 16:14:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoQ3srLRvL7IW+9UlL/COR/GsU0pPN2ekjKLRPuXMYXD+KzwU7/4oj7w8UQ4YsnTvtvOHw X-Received: by 2002:a50:f29a:: with SMTP id f26mr37504664edm.13.1618355658790; Tue, 13 Apr 2021 16:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618355658; cv=none; d=google.com; s=arc-20160816; b=g36ItBsOCmtsCI+Go8PQIB/4w++lCTuF27ZCUxjQ4YFY4AIsTvlU8yjF5MSLrjhhWS n5Kb/WHGvCl0pY21pql+eO9UDQokVHRFUlDtqaoRC6FD2EJKHHKJadC2JIcS8EQkpI+y l7sXjjcdOKPOYZEg5BVij78TMI7+51GlpDDzaqdo8c80Pm45ueGHAu7QD1IBCMvG6DI8 NZRCER4Pxu2BAiEdgvbRefQRVLRZG7Ne1Jo2vyD215I/u0DrdCM/5UfwYlgVbG/lB3Zt Y/aWDK/tUkJ+zxhOFzwQC/w+UQDKWIM6KSD9WRmuwokKOF7GKLtKe6IQKt+TEdMFeVal 8VSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=3Ek1Or5gYq6auk/n55uXL3TA8UKIpfxVBA3Yj9gk6w8=; b=aKPfa39Cjjt+JhxL00EN1WhBDaqxIpQPCpkVVCc3ImPnIOoxJwcXsM60cb5Tq7RGb9 uPY6YT06F13yvAEfuPLiEel5FKjghKtdwNB7AnLVkYsg+j+OyKWLiRfs9e9YZFKljgi6 vYR73Z/pOzw6zBhWqmdkxveFNcIHMnx2gNeQu4rVuF5upzgl5aFx1xZOjwfNka7NJzf1 Euc1SRQQlF7fkf8hFtfP5PmzkNG4ukR6+gb3Q8MMRjGMGRU/O0iwWqXWFWNSBfRTG3hn LCF/RnM5ZuZoSbdgsYeiHRHw/ClVG3on3ylTPagARYv4bl9MUq1o134jW4OIDdn69OVA rdrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=AsgNogS2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v13si10987455edw.250.2021.04.13.16.13.55; Tue, 13 Apr 2021 16:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=AsgNogS2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbhDMTHH (ORCPT + 99 others); Tue, 13 Apr 2021 15:07:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbhDMTHG (ORCPT ); Tue, 13 Apr 2021 15:07:06 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 748D8C061574 for ; Tue, 13 Apr 2021 12:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject :To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3Ek1Or5gYq6auk/n55uXL3TA8UKIpfxVBA3Yj9gk6w8=; b=AsgNogS2ThUjoZUoVzn850Kzfs Rc8pAFmR5lXTfWC/RyaEEgAkbp8ndYXxjAjD/OglBrhs2am90zAcMyOytVSEyi/YjSPsHnKY+fd5e +yeuwL9+SRuSRll1wptR68J1thW0sFf+KfaOFc7PtfjEq0ULp9uxsUIPv3becbkLoOks=; Received: from p4ff13c8d.dip0.t-ipconnect.de ([79.241.60.141] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1lWON2-0005m3-B9 for linux-wireless@vger.kernel.org; Tue, 13 Apr 2021 21:06:44 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH] mt76: flush tx status queue on DMA reset Date: Tue, 13 Apr 2021 21:06:41 +0200 Message-Id: <20210413190641.88320-1-nbd@nbd.name> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org After DMA reset, tx status information for queued frames will never arrive. Flush the queue to free skbs immediately instead of waiting for a timeout Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7603/mac.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7915/mac.c | 2 ++ drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 2 ++ 5 files changed, 10 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c index e3a9dd6fbd87..fbceb07c5f37 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c @@ -1445,6 +1445,8 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev) mt76_queue_rx_reset(dev, i); } + mt76_tx_status_check(&dev->mt76, NULL, true); + mt7603_dma_sched_reset(dev); mt7603_mac_dma_start(dev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c index 9ac4bdabc0ef..8cd79e849045 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c @@ -201,6 +201,8 @@ void mt7615_dma_reset(struct mt7615_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_rx_reset(dev, i); + mt76_tx_status_check(&dev->mt76, NULL, true); + mt7615_dma_start(dev); } EXPORT_SYMBOL_GPL(mt7615_dma_reset); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c index fc12824ab74e..ce1e9ad23fec 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c @@ -472,6 +472,8 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev) mt76_queue_rx_reset(dev, i); } + mt76_tx_status_check(&dev->mt76, NULL, true); + mt76x02_mac_start(dev); if (dev->ed_monitor) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c index 35ab4bf011eb..6a4b57509751 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c @@ -1564,6 +1564,8 @@ mt7915_dma_reset(struct mt7915_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_rx_reset(dev, i); + mt76_tx_status_check(&dev->mt76, NULL, true); + /* re-init prefetch settings after reset */ mt7915_dma_prefetch(dev); diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c index b507f3917830..572bab82315a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c @@ -1254,6 +1254,8 @@ mt7921_dma_reset(struct mt7921_dev *dev) mt76_for_each_q_rx(&dev->mt76, i) mt76_queue_reset(dev, &dev->mt76.q_rx[i]); + mt76_tx_status_check(&dev->mt76, NULL, true); + /* configure perfetch settings */ mt7921_dma_prefetch(dev); -- 2.30.1