From patchwork Wed Feb 17 03:44:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 583906 X-Patchwork-Delegate: benh@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C6F9514010F for ; Wed, 17 Feb 2016 15:42:06 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id A48331A34FA for ; Wed, 17 Feb 2016 15:42:06 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id B24761A0338 for ; Wed, 17 Feb 2016 14:46:18 +1100 (AEDT) Received: from localhost by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Feb 2016 13:46:17 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 17 Feb 2016 13:46:16 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: gwshan@linux.vnet.ibm.com X-IBM-RcptTo: linuxppc-dev@lists.ozlabs.org Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id F1C2E3578057 for ; Wed, 17 Feb 2016 14:46:15 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1H3k7Ob49283158 for ; Wed, 17 Feb 2016 14:46:15 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1H3jg9c004182 for ; Wed, 17 Feb 2016 14:45:43 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u1H3jgi5003266; Wed, 17 Feb 2016 14:45:42 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id A735FA03CB; Wed, 17 Feb 2016 14:44:38 +1100 (AEDT) Received: from gwshan (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 9E468E39C0; Wed, 17 Feb 2016 14:44:38 +1100 (AEDT) Received: by gwshan (Postfix, from userid 1000) id 844AD941E93; Wed, 17 Feb 2016 14:44:38 +1100 (AEDT) From: Gavin Shan To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH v8 22/45] powerpc/powernv/ioda1: Support releasing IODA1 TCE table Date: Wed, 17 Feb 2016 14:44:05 +1100 Message-Id: <1455680668-23298-23-git-send-email-gwshan@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1455680668-23298-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1455680668-23298-1-git-send-email-gwshan@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16021703-0005-0000-0000-000003554886 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, aik@ozlabs.ru, linux-pci@vger.kernel.org, Gavin Shan , grant.likely@linaro.org, robherring2@gmail.com, bhelgaas@google.com, dja@axtens.net MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" pnv_pci_ioda_table_free_pages() can be reused to release the IODA1 TCE table when releasing IODA1 PE in subsequent patches. This renames the following functions to support releasing IODA1 TCE table: pnv_pci_ioda2_table_free_pages() to pnv_pci_ioda_table_free_pages(), pnv_pci_ioda2_table_do_free_pages() to pnv_pci_ioda_table_do_free_pages(). No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index d360607..077f9db 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -51,7 +51,7 @@ #define POWERNV_IOMMU_DEFAULT_LEVELS 1 #define POWERNV_IOMMU_MAX_LEVELS 5 -static void pnv_pci_ioda2_table_free_pages(struct iommu_table *tbl); +static void pnv_pci_ioda_table_free_pages(struct iommu_table *tbl); static void pe_level_printk(const struct pnv_ioda_pe *pe, const char *level, const char *fmt, ...) @@ -1352,7 +1352,7 @@ static void pnv_pci_ioda2_release_dma_pe(struct pci_dev *dev, struct pnv_ioda_pe iommu_group_put(pe->table_group.group); BUG_ON(pe->table_group.group); } - pnv_pci_ioda2_table_free_pages(tbl); + pnv_pci_ioda_table_free_pages(tbl); iommu_free_table(tbl, of_node_full_name(dev->dev.of_node)); } @@ -1946,7 +1946,7 @@ static void pnv_ioda2_tce_free(struct iommu_table *tbl, long index, static void pnv_ioda2_table_free(struct iommu_table *tbl) { - pnv_pci_ioda2_table_free_pages(tbl); + pnv_pci_ioda_table_free_pages(tbl); iommu_free_table(tbl, "pnv"); } @@ -2448,7 +2448,7 @@ static __be64 *pnv_pci_ioda2_table_do_alloc_pages(int nid, unsigned shift, return addr; } -static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr, +static void pnv_pci_ioda_table_do_free_pages(__be64 *addr, unsigned long size, unsigned level); static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, @@ -2487,7 +2487,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, * release partially allocated table. */ if (offset < tce_table_size) { - pnv_pci_ioda2_table_do_free_pages(addr, + pnv_pci_ioda_table_do_free_pages(addr, 1ULL << (level_shift - 3), levels - 1); return -ENOMEM; } @@ -2505,7 +2505,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, return 0; } -static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr, +static void pnv_pci_ioda_table_do_free_pages(__be64 *addr, unsigned long size, unsigned level) { const unsigned long addr_ul = (unsigned long) addr & @@ -2521,7 +2521,7 @@ static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr, if (!(hpa & (TCE_PCI_READ | TCE_PCI_WRITE))) continue; - pnv_pci_ioda2_table_do_free_pages(__va(hpa), size, + pnv_pci_ioda_table_do_free_pages(__va(hpa), size, level - 1); } } @@ -2529,7 +2529,7 @@ static void pnv_pci_ioda2_table_do_free_pages(__be64 *addr, free_pages(addr_ul, get_order(size << 3)); } -static void pnv_pci_ioda2_table_free_pages(struct iommu_table *tbl) +static void pnv_pci_ioda_table_free_pages(struct iommu_table *tbl) { const unsigned long size = tbl->it_indirect_levels ? tbl->it_level_size : tbl->it_size; @@ -2537,7 +2537,7 @@ static void pnv_pci_ioda2_table_free_pages(struct iommu_table *tbl) if (!tbl->it_size) return; - pnv_pci_ioda2_table_do_free_pages((__be64 *)tbl->it_base, size, + pnv_pci_ioda_table_do_free_pages((__be64 *)tbl->it_base, size, tbl->it_indirect_levels); }