From patchwork Tue Apr 28 18:25:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 226864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8C3AC83007 for ; Tue, 28 Apr 2020 18:43:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8ECE52076A for ; Tue, 28 Apr 2020 18:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099391; bh=VoQ9RG6ik9+K4WK3BZWxzUToyv+K9LGBGwQ0IETt9f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qhgewTAbyYR6dFazLvR6e7pAz2w500BlYmsfF/terV99BEw8Xc1DKirqH9CiekIhy v6sD9+rK7Yh3gLNJuMvcAZOce4y3hlP+S4sK3M2AriTCoKxZ68OtYesjKVn6uBRXVp LBCQrSyWemloNe5GFynrfpE2XfXkcZm6toF2zCG8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730967AbgD1SnK (ORCPT ); Tue, 28 Apr 2020 14:43:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:35366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730267AbgD1SnG (ORCPT ); Tue, 28 Apr 2020 14:43:06 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89B6D2085B; Tue, 28 Apr 2020 18:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588099386; bh=VoQ9RG6ik9+K4WK3BZWxzUToyv+K9LGBGwQ0IETt9f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OOcTL4wAtqVRrB2Gt2DsnGOItr3yph8LpJKKvisplEWnkOsyCdOLd3agXccn84Trr kGtdcIlqFveQYqXE6LboJoJklLk3r42YjHS0jvMfon4RVfbUEJcjMGBI0MpSwqD1Ii 689/hKnunPCQ9HS5IMMhsVgaKaxlfQ7cX+5tV4c4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Luca Coelho , Kalle Valo Subject: [PATCH 5.4 128/168] iwlwifi: pcie: actually release queue memory in TVQM Date: Tue, 28 Apr 2020 20:25:02 +0200 Message-Id: <20200428182248.371321557@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428182231.704304409@linuxfoundation.org> References: <20200428182231.704304409@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johannes Berg commit b98b33d5560a2d940f3b80f6768a6177bf3dfbc0 upstream. 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 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20200417100405.f5f4c4193ec1.Id5feebc9b4318041913a9c89fc1378bb5454292c@changeid Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c @@ -1283,6 +1283,9 @@ void iwl_trans_pcie_dyn_txq_free(struct 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); }