Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1471102ybl; Tue, 13 Aug 2019 13:14:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVM8yaq9ui3TxJcdMipqzDD31Zw0KyLy1N0g4bctvuAO/XlgJhcSsoVRg2+QS+hGIg416s X-Received: by 2002:a62:3883:: with SMTP id f125mr42914179pfa.258.1565727290404; Tue, 13 Aug 2019 13:14:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565727290; cv=none; d=google.com; s=arc-20160816; b=bpJK0GUVMpjHT23pQV03MUs/BauWWQEG+rLi/MP3GT3vXkcIVw3LlnP3CWGPaPRsMg THO8hizDpsBFIFFJZTaU6laGikeJTg3/PpFM7f0odak6DrCaAsDA1t0PNNCXtLy/rZde GLHdZNKg+p0tJ8sS2F+PHKK5mXpOCXiL5mFnjzs/W8O/5Y807tizKY8Rp63WpT2ly3Ca YoQNV7ra83Gj5jIjjWzoLzzPHdCFoPtaUP9OefM2P0aIQumB28N0lpuiaoe51SInUTQ2 ZldoLfSldNEpsDIGkogDMPi8JQO3Ctj+Q+M6bhpIwIZM6o7o8FDBF8MWoJy/Syg3MlNs 97iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=WeqLxZtr9LFGc7QK6NMnLOJ1YD4PPAgjsmOOJfb818k=; b=Weugwewru13wfaLT3OHCVZlCQO5t0FJlwjDdrTLzfo0H8dxkWHjFtC2OIBTPSJOnij L1SzUWadhS1W7ZHZfecCOaXyp1rmN+VaGNT8nwmBMibXMIAlpzya8cSoK+HbN7lUPtwe /hjDjYU5UgG6mHAL5mpkCe2pj8OI44js5DfoB8XQBt/L/cxCkh2MQqZFQkTinzArVdzr IPTeqxLlMVoAJnNjQHbjXogExfnujdx4K1XDRW2chPTZ7ui+0j+VOrarxMHsTm6cTN/h rZzHJ32spokNsXARd05NfXtGf0LcAJwy01z7pWpax1OAOm3mAGiXWAwS1u0qMa4s9GFB 4qwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=qfBhulLY; 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 g11si5748767plm.230.2019.08.13.13.14.34; Tue, 13 Aug 2019 13:14:50 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=qfBhulLY; 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 S1726997AbfHMUL5 (ORCPT + 99 others); Tue, 13 Aug 2019 16:11:57 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:35063 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbfHMULn (ORCPT ); Tue, 13 Aug 2019 16:11:43 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 467P4Y3wJNz9v0CS; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=qfBhulLY; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id rA5jPD3yY6uL; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 467P4Y2th6z9v0CM; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1565727101; bh=WeqLxZtr9LFGc7QK6NMnLOJ1YD4PPAgjsmOOJfb818k=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=qfBhulLYnl51N21MMmLo279huThx4jtQC1qL/WJcUFmpbPx8PTjrw1K3k7b6Y0ZO+ FYy/8s4IkGcFglyJOCtxis2ByUI9v+BXncZusntKKvVvroHEDSY4jatCdbgBgo16EN AYMorBS8NijUeTXcFx7gvjmzMBInGqEat3OfdzF0= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 89C298B7F2; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id eGQYKY7h5hGX; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) Received: from pc17473vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4C8068B7F0; Tue, 13 Aug 2019 22:11:41 +0200 (CEST) Received: by pc17473vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 2DF2469632; Tue, 13 Aug 2019 20:11:41 +0000 (UTC) Message-Id: <84bab66e7afc4b35e2bd460a87b5911c1b0830d2.1565726867.git.christophe.leroy@c-s.fr> In-Reply-To: <6bc35eca507359075528bc0e55938bc1ce8ee485.1565726867.git.christophe.leroy@c-s.fr> References: <6bc35eca507359075528bc0e55938bc1ce8ee485.1565726867.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v1 08/10] powerpc/mm: move __ioremap_at() and __iounmap_at() into ioremap.c To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Tue, 13 Aug 2019 20:11:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allthough __ioremap_at() and __iounmap_at() are specific to PPC64, lets move them into ioremap.c as it wouldn't be worth creating an ioremap_64.c only for those functions. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ioremap.c | 43 +++++++++++++++++++++++++++++++++++++++++++ arch/powerpc/mm/pgtable_64.c | 42 ------------------------------------------ 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/arch/powerpc/mm/ioremap.c b/arch/powerpc/mm/ioremap.c index 57d742509cec..889ee656cf64 100644 --- a/arch/powerpc/mm/ioremap.c +++ b/arch/powerpc/mm/ioremap.c @@ -103,3 +103,46 @@ void iounmap(volatile void __iomem *token) vunmap(addr); } EXPORT_SYMBOL(iounmap); + +#ifdef CONFIG_PPC64 +/** + * __ioremap_at - Low level function to establish the page tables + * for an IO mapping + */ +void __iomem *__ioremap_at(phys_addr_t pa, void *ea, unsigned long size, pgprot_t prot) +{ + /* We don't support the 4K PFN hack with ioremap */ + if (pgprot_val(prot) & H_PAGE_4K_PFN) + return NULL; + + if ((ea + size) >= (void *)IOREMAP_END) { + pr_warn("Outside the supported range\n"); + return NULL; + } + + WARN_ON(pa & ~PAGE_MASK); + WARN_ON(((unsigned long)ea) & ~PAGE_MASK); + WARN_ON(size & ~PAGE_MASK); + + if (ioremap_range((unsigned long)ea, pa, size, prot, NUMA_NO_NODE)) + return NULL; + + return (void __iomem *)ea; +} +EXPORT_SYMBOL(__ioremap_at); + +/** + * __iounmap_from - Low level function to tear down the page tables + * for an IO mapping. This is used for mappings that + * are manipulated manually, like partial unmapping of + * PCI IOs or ISA space. + */ +void __iounmap_at(void *ea, unsigned long size) +{ + WARN_ON(((unsigned long)ea) & ~PAGE_MASK); + WARN_ON(size & ~PAGE_MASK); + + unmap_kernel_range((unsigned long)ea, size); +} +EXPORT_SYMBOL(__iounmap_at); +#endif diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c index b50a53a0a42b..32220f7381d7 100644 --- a/arch/powerpc/mm/pgtable_64.c +++ b/arch/powerpc/mm/pgtable_64.c @@ -119,45 +119,6 @@ int __weak ioremap_range(unsigned long ea, phys_addr_t pa, unsigned long size, p return 0; } -/** - * __ioremap_at - Low level function to establish the page tables - * for an IO mapping - */ -void __iomem *__ioremap_at(phys_addr_t pa, void *ea, unsigned long size, pgprot_t prot) -{ - /* We don't support the 4K PFN hack with ioremap */ - if (pgprot_val(prot) & H_PAGE_4K_PFN) - return NULL; - - if ((ea + size) >= (void *)IOREMAP_END) { - pr_warn("Outside the supported range\n"); - return NULL; - } - - WARN_ON(pa & ~PAGE_MASK); - WARN_ON(((unsigned long)ea) & ~PAGE_MASK); - WARN_ON(size & ~PAGE_MASK); - - if (ioremap_range((unsigned long)ea, pa, size, prot, NUMA_NO_NODE)) - return NULL; - - return (void __iomem *)ea; -} - -/** - * __iounmap_from - Low level function to tear down the page tables - * for an IO mapping. This is used for mappings that - * are manipulated manually, like partial unmapping of - * PCI IOs or ISA space. - */ -void __iounmap_at(void *ea, unsigned long size) -{ - WARN_ON(((unsigned long)ea) & ~PAGE_MASK); - WARN_ON(size & ~PAGE_MASK); - - unmap_kernel_range((unsigned long)ea, size); -} - void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size, pgprot_t prot, void *caller) { @@ -201,9 +162,6 @@ void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size, return ret; } -EXPORT_SYMBOL(__ioremap_at); -EXPORT_SYMBOL(__iounmap_at); - #ifndef __PAGETABLE_PUD_FOLDED /* 4 level page table */ struct page *pgd_page(pgd_t pgd) -- 2.13.3