Received: by 10.192.165.148 with SMTP id m20csp729354imm; Fri, 4 May 2018 05:37:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr1pKCXoXKzMH8ziaXWwr5hwOxlOtMLq6uXZTkU5aD/m+D1f7jaADH2lomNLdkOWxawmcvH X-Received: by 2002:a63:381e:: with SMTP id f30-v6mr9812771pga.142.1525437437542; Fri, 04 May 2018 05:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525437437; cv=none; d=google.com; s=arc-20160816; b=dt4HBtTu2eLdpmEUFa4kOjfSNyl/zTcXzarTi+rKBJkmxE6n281oAtf179u5EhsF9N 59zZvDhdjE01v2M5om+TZtmrRhfzJcHKXPLNJYrTU8mJmhNctg5GcKZPGCwr15Pnao2r WyzzDW0oFVWc3SrsAH2KxRzlq0AzW1AVl7ksoqDQ5a9uVEt2kx3K2crXivB46p1SLK0U Yh54bS5Z4BEOkbPdsYXCcu9htPLFzqqJ1+CkHxFpQ4r3dckQjV68lWMAf35q6My3V9G9 NUk1yUd7St4BqIR9ka6BNh2xMjZZWV1m89jzuLt5PJl1Peyr7ySyayy7/x56SdmfkiAM 9k6Q== 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:arc-authentication-results; bh=BPkp4dufp3wITxWqstI3ggRhGl0JsQBG/7OCcuFSnK8=; b=QbvwlGr0cIteLbi1EJVKXSkhA8rLHNAji7IMDr9n0qiTMPF/jLpApc53X2GCQufTFM urBpVhVQWsCr4czM32wMmTY+RMpGBLPYFlrP6l71essOENe1BpxmUPgucoKTJ7Rky6eV YAoGN7NejvSv85h1nAAZioXG0uJohsNuyUz0AkSI+oI1dR8iQlET6lnKP29Ef4iShXUD ZPI+gtrNPNa15uy15/bdARCxmZ4Ge8IkQ0Nlyo00LkYAWvWX70FPklLQKcIPtlLDF0Ke sn3S7Ve0l7mCD73i4ud33XwfNvTi9KtdRpdq/MZWjbH2tO4/dNP/i2bU3zIC5NvCKquX 7v+g== 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 b62-v6si12708707pgc.505.2018.05.04.05.37.02; Fri, 04 May 2018 05:37:17 -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 S1751599AbeEDMeK (ORCPT + 99 others); Fri, 4 May 2018 08:34:10 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:18914 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbeEDMeI (ORCPT ); Fri, 4 May 2018 08:34:08 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 40crzb2njVz9txcV; Fri, 4 May 2018 14:34:03 +0200 (CEST) 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 hpHt49FeJOoF; Fri, 4 May 2018 14:34:03 +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 40crzb2HTHz9ttC1; Fri, 4 May 2018 14:34:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 051CB8B975; Fri, 4 May 2018 14:34:07 +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 jxB2PAAXrrKy; Fri, 4 May 2018 14:34:06 +0200 (CEST) Received: from po14934vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DBB3D8B972; Fri, 4 May 2018 14:34:06 +0200 (CEST) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id BD7DF6CF2D; Fri, 4 May 2018 14:34:06 +0200 (CEST) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 08/17] powerpc: make __iounmap() common to PPC32 and PPC64 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 4 May 2018 14:34:06 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch makes __iounmap() common to PPC32 and PPC64. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ioremap.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/arch/powerpc/mm/ioremap.c b/arch/powerpc/mm/ioremap.c index 153657db084e..65d611d44d38 100644 --- a/arch/powerpc/mm/ioremap.c +++ b/arch/powerpc/mm/ioremap.c @@ -120,20 +120,6 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags, return (void __iomem *) (v + ((unsigned long)addr & ~PAGE_MASK)); } -void __iounmap(volatile void __iomem *addr) -{ - /* - * If mapped by BATs then there is nothing to do. - * Calling vfree() generates a benign warning. - */ - if (v_block_mapped((unsigned long)addr)) - return; - - if ((unsigned long) addr >= ioremap_bot) - vunmap((void *) (PAGE_MASK & (unsigned long)addr)); -} -EXPORT_SYMBOL(__iounmap); - #else /** @@ -225,6 +211,8 @@ void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size, return ret; } +#endif + /* * Unmap an IO region and remove it from imalloc'd list. * Access to IO memory should be serialized by driver. @@ -238,6 +226,14 @@ void __iounmap(volatile void __iomem *token) addr = (void *) ((unsigned long __force) PCI_FIX_ADDR(token) & PAGE_MASK); + + /* + * If mapped by BATs then there is nothing to do. + * Calling vfree() generates a benign warning. + */ + if (v_block_mapped((unsigned long)addr)) + return; + if ((unsigned long)addr < ioremap_bot) { printk(KERN_WARNING "Attempt to iounmap early bolted mapping" " at 0x%p\n", addr); @@ -247,8 +243,6 @@ void __iounmap(volatile void __iomem *token) } EXPORT_SYMBOL(__iounmap); -#endif - void __iomem * __ioremap(phys_addr_t addr, unsigned long size, unsigned long flags) { -- 2.13.3