Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2403822ybi; Mon, 1 Jul 2019 11:24:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTeExYaKfZUiK9ocOpLvUgDUm6MFRy99OTunhJBCtYXMjeEMTOM5g+/melmstW1RPVIOjs X-Received: by 2002:a17:902:4623:: with SMTP id o32mr29914221pld.112.1562005489501; Mon, 01 Jul 2019 11:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562005489; cv=none; d=google.com; s=arc-20160816; b=RNyrkRMsuX+9HddseTYmRqFS3gh89gaBA+YRegjUkHItjZnhkKqp6oiI/TUQ1wDu7x X2bzYtTvccfqlgiKVhtKcMTO/H0FmYj6a7XxU0og6+FRNSGTz44GQJCZ+4AfInR7J5WN 89KVSQRUBqPvL46ks9ghCduqcan4wLwZXKz/ZSBNtEymc/lJ5YP0Tw/WTiPOlU6C1EPi m/OdkebXgEr0W0/uM0V3xlb9q4giwFIY0dF78WWLnXx2H94tMib6NYknasyJhiCTaCj7 vUJTJNh3t3zz5Ra3q3DhFbY7E6x3+bUkHC4ecPS9xJgTzAEtHJMqUgGxZiLQ1XoJPGPq aVPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from :dkim-signature; bh=9X3e2qSfmHu3g2gCoZyH9lge8kBO0ioGTySFUJ3JZV4=; b=ifdUUa9FSUtE6MoNdlWoTlM4NKybqQ48PFDwrYlZp04rnwfLyPsvCr1eFjNnslGmte NYFMt5GUWsOG+5wo00mmTsnaFHZRdEmslmb1+WHmUvxyggm/kQExJuqyh0ZT6gspu630 Do40ZqQkpL1UlwcBLrruYhnMlTWPgUzJIvIZDPzb2MtUU4ScXEPRqo2uWcU7xSnqWEjk Qpv//lY5LT7DAo+YsDEI6g6xh46gqegXOQB9ecjLFpWL5aVyHr/xzMJ+X5T00T6mWKV3 8YYBoORNzIJaRQlrXn3Ipeg9LI6nLuFCAJY0eek3IQ/8zYo20jwrHzGciCEErpZtfJH+ j4aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=kDh20Xkh; 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 d1si1917260pld.318.2019.07.01.11.24.23; Mon, 01 Jul 2019 11:24:49 -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; dkim=fail header.i=@nbd.name header.s=20160729 header.b=kDh20Xkh; 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 S1727263AbfGASUX (ORCPT + 99 others); Mon, 1 Jul 2019 14:20:23 -0400 Received: from nbd.name ([46.4.11.11]:44392 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727255AbfGASUX (ORCPT ); Mon, 1 Jul 2019 14:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding: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=9X3e2qSfmHu3g2gCoZyH9lge8kBO0ioGTySFUJ3JZV4=; b=kDh20Xkh2oQDK61Ldx2F3lwQ2t LyQ+Zu0zkw5GVEJOAUtfVfwKd41sBXwv2Q4hidJtijYV7NLxUiMJXTE+3Njd4ncUcTvCtW2wGLUEW 0DC47JMzBVORazucSdlpr2iieRt/OTBtwKCDcMYVAhKnGRsQnxWcNK7GnDs6V9pGfKC8=; Received: from p54ae9425.dip0.t-ipconnect.de ([84.174.148.37] helo=maeck-3.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hi0ub-0007zy-T8 for linux-wireless@vger.kernel.org; Mon, 01 Jul 2019 20:20:21 +0200 Received: by maeck-3.local (Postfix, from userid 501) id 2003360F54D4; Mon, 1 Jul 2019 20:20:20 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH] mt76: mt7615: clean up FWDL TXQ during/after firmware upload Date: Mon, 1 Jul 2019 20:20:20 +0200 Message-Id: <20190701182020.6144-1-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Since we don't clean that tx queue from the tx tasklet, we need to do it after the firmware upload is done. This patch also adds a cleanup step during the upload, to help reclaim memory faster. Fixes unprocessed queued frames eating up memory long after the firmware upload has already completed Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 06d146198e33..de371bd2e0b9 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -248,6 +248,7 @@ static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data, data += cur_len; len -= cur_len; + mt76_queue_tx_cleanup(dev, MT_TXQ_FWDL, false); } return ret; @@ -525,6 +526,8 @@ static int mt7615_load_firmware(struct mt7615_dev *dev) return -EIO; } + mt76_queue_tx_cleanup(dev, MT_TXQ_FWDL, false); + dev_dbg(dev->mt76.dev, "Firmware init done\n"); return 0; -- 2.17.0