Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3062526imm; Sun, 1 Jul 2018 11:21:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIgTVZ7fXmcWeubUPN9V0kNXEjC8fym8cbSVoC/qaawaeYjwL3G2YepKJqmVPOklyhLGRtx X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr23187985plm.289.1530469301661; Sun, 01 Jul 2018 11:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530469301; cv=none; d=google.com; s=arc-20160816; b=UAqeIGKyZsT1tuOEWHk7PARWZNAkzHxadyl2p+/IZjiMjCMmKXtlwVUyxnOJ72HDdm 7KDG29F8Kg/fEyRQwEO7rdqjTdlB6egWZQYiO7acEFp1SzI9mgdtF1ykWx2VbC9RKcn5 m10wPRqjx+kNoza06HMWr/bT6T1g/Wq496roecFGGZ8WqtBwKnnGtHzUzbUDZMCpxNnv 6v2hm0Fqprd2j8OZxawcv5nlIuQGqt0NRRmK13KTF7XRy7H/zbo0bI5dCbZ1J+vDnm9U r2fkKgCkWapTtlLcvnXHcOtyKfndsAsjb+t1KRGzepeOJVoRtf8/HdfCd4Z/SSs6Gwp0 6qmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wCWBXD/WnPeTPFmLboToXgkUlIlYHRfVM9UtkTgFwWM=; b=XjC3omMmwadRo9af5jCcX3nUC1S5xqTg5NH3Bkgq0e0yoIjH0vF0gfpKCHhjxsxeUD 8UCzCQEt0/FcySD84tFL41rbvEwRonB+CXp6TSzCc91NsEAMbwK+y/Ozn6jSj2CfHFti /uusmw96yZqkkJnYByH1Ch8VrElonrzuv83y7UvuknJGNY7intPC+oB72N59fwpjqwOQ CfdYORXfR0OeZ5guH7LDC5yLFBzE7GiemfGHfplplGdJq/6zDT2PJ7KOtPS21wM/m69C ZBnPm/NhJ+VVhWqyR6fHXgJnEuzkx0GCo7dDsjnGZcOYK1lUGkc5IHTJzO2ySKIMWY8L 0vIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 x1-v6si12663147pga.205.2018.07.01.11.21.27; Sun, 01 Jul 2018 11:21:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965065AbeGASUL (ORCPT + 99 others); Sun, 1 Jul 2018 14:20:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33644 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965067AbeGAQZP (ORCPT ); Sun, 1 Jul 2018 12:25:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 23DBCACD; Sun, 1 Jul 2018 16:25:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kardashevskiy , Michael Ellerman Subject: [PATCH 4.9 027/101] powerpc/powernv/ioda2: Remove redundant free of TCE pages Date: Sun, 1 Jul 2018 18:21:13 +0200 Message-Id: <20180701160758.232618323@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Kardashevskiy commit 98fd72fe82527fd26618062b60cfd329451f2329 upstream. When IODA2 creates a PE, it creates an IOMMU table with it_ops::free set to pnv_ioda2_table_free() which calls pnv_pci_ioda2_table_free_pages(). Since iommu_tce_table_put() calls it_ops::free when the last reference to the table is released, explicit call to pnv_pci_ioda2_table_free_pages() is not needed so let's remove it. This should fix double free in the case of PCI hotuplug as pnv_pci_ioda2_table_free_pages() does not reset neither iommu_table::it_base nor ::it_size. This was not exposed by SRIOV as it uses different code path via pnv_pcibios_sriov_disable(). IODA1 does not inialize it_ops::free so it does not have this issue. Fixes: c5f7700bbd2e ("powerpc/powernv: Dynamically release PE") Cc: stable@vger.kernel.org # v4.8+ Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/pci-ioda.c | 1 - 1 file changed, 1 deletion(-) --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -3424,7 +3424,6 @@ static void pnv_pci_ioda2_release_pe_dma WARN_ON(pe->table_group.group); } - pnv_pci_ioda2_table_free_pages(tbl); iommu_free_table(tbl, "pnv"); }