Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp233954ybb; Fri, 3 Apr 2020 01:31:27 -0700 (PDT) X-Google-Smtp-Source: APiQypIl1oK6sAUWVmQIR28r8rMFmq9cAom9gtEc5soxJwOucXUvQFME9+PgJGx8/SljOnsBwj5L X-Received: by 2002:a9d:69ca:: with SMTP id v10mr5272024oto.64.1585902687163; Fri, 03 Apr 2020 01:31:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585902687; cv=none; d=google.com; s=arc-20160816; b=HyI4duMffedCQLvAJbYMDF9BmvlQN6pcCMCL/3+kPBpuFnEqTi63YcXMIAXD+ZtvY6 6Vv3paVN7iMBq6JEbeUjVG6CgdnxZ/psKrGXNEPRtwwjY0B/VzeMWIW8jhhHoo8a3RIS ABfHA4PKM1YJM7fKOZzLI4WkS5BzRgqkU7O3IgPZG9fZOaIMk2QkJlMLRWYfnlQDEgZa rIkwKjk8TxbRLr4lfUeZEpnZN3qYY7E64J0HoJqvj7WOnlKdQzWhGtpD2D6F/qBUzGcd CBeerjbLF83opMUfdo5QdM4+leLDk0bto8VPQUKED//DYH5s137uNDA9LbZ/2S6gIl+L QRPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=Kn4v8gDMMC3u50kCSfMnjr/6dU3zcUIe6Xbe+W1lw88=; b=K99CQVsru5dFO3KUHgTOkN30crqIAljzyzmbYYHozkvD27hMmHfkE9g0CTpSJx+rW6 tSjDUQYS95ijo7s3eG3S8mdADUXpdtePo4pMmozYwprFj2Nb4q/GUgL2+MH0rlr+Nlrm EXbNt5gnJFxLRNuQPYIFDjXX0q9IMSR/wQ/y8R2YS2BoLt32D+XqW4wBmc2cPu7B5Akf 36F56K9nzK6OjsIB6KzsDngcWJjqjr73bEAvyHwCMdASpYbp41VFgvY8jaqfXAAhlrIO oY3FGlB85ctAkpJloz5OLw1G6DBe5pnjRSYuqfZdaKs/79rvNV6VAFxUFtxysK7y7dMk x83g== 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 s199si3356340oih.169.2020.04.03.01.31.03; Fri, 03 Apr 2020 01:31:27 -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 S2390405AbgDCIaH (ORCPT + 99 others); Fri, 3 Apr 2020 04:30:07 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:45438 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727803AbgDCIaG (ORCPT ); Fri, 3 Apr 2020 04:30:06 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jKHiG-0008yu-Aq; Fri, 03 Apr 2020 11:30:04 +0300 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Fri, 3 Apr 2020 11:29:48 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200403082955.1126339-1-luca@coelho.fi> References: <20200403082955.1126339-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.4 Subject: [PATCH v5.7 1/8] iwlwifi: pcie: actually release queue memory in TVQM Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg The iwl_trans_pcie_dyn_txq_free() function only releases the frames that may be left on the queue by calling iwl_pcie_gen2_txq_unmap(), but doesn't actually free the DMA ring or byte-count tables for the queue. This leads to pretty large memory leaks (at least before my queue size improvements), in particular in monitor/sniffer mode on channel hopping since this happens on every channel change. This was also now more evident after the move to a DMA pool for the byte count tables, showing messages such as BUG iwlwifi:bc (...): Objects remaining in iwlwifi:bc on __kmem_cache_shutdown() This fixes https://bugzilla.kernel.org/show_bug.cgi?id=206811. Signed-off-by: Johannes Berg Fixes: 6b35ff91572f ("iwlwifi: pcie: introduce a000 TX queues management") Cc: stable@vger.kernel.org # v4.14+ Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c index 86fc00167817..9664dbc70ef1 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c @@ -1418,6 +1418,9 @@ void iwl_trans_pcie_dyn_txq_free(struct iwl_trans *trans, int queue) iwl_pcie_gen2_txq_unmap(trans, queue); + iwl_pcie_gen2_txq_free_memory(trans, trans_pcie->txq[queue]); + trans_pcie->txq[queue] = NULL; + IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", queue); } -- 2.25.1