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: 8334311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 49D7DC02AA for ; Wed, 17 Feb 2016 03:46:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 67A11202FE for ; Wed, 17 Feb 2016 03:46:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E57A72034C for ; Wed, 17 Feb 2016 03:46:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965229AbcBQDqZ (ORCPT ); Tue, 16 Feb 2016 22:46:25 -0500 Received: from e23smtp04.au.ibm.com ([202.81.31.146]:35193 "EHLO e23smtp04.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965225AbcBQDqV (ORCPT ); Tue, 16 Feb 2016 22:46:21 -0500 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Feb 2016 13:46:18 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp04.au.ibm.com (202.81.31.210) 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: devicetree@vger.kernel.org;linux-pci@vger.kernel.org Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 3C5FD357805A; Wed, 17 Feb 2016 14:46:16 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1H3k8kK57016468; Wed, 17 Feb 2016 14:46:16 +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 u1H3jg9g004182; Wed, 17 Feb 2016 14:45:44 +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 Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, benh@kernel.crashing.org, mpe@ellerman.id.au, aik@ozlabs.ru, dja@axtens.net, bhelgaas@google.com, robherring2@gmail.com, grant.likely@linaro.org, Gavin Shan 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-0013-0000-0000-000002BF0A88 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }