Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp242305rwd; Mon, 15 May 2023 23:53:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RmZ20R+K9P9GZy1BWYjN8lRze3fIryyk9sO8iB2P/K3hRfWtAHx0Dl+nOD4laZnaUuWVC X-Received: by 2002:a05:6a00:190e:b0:64b:20cd:6d52 with SMTP id y14-20020a056a00190e00b0064b20cd6d52mr12075013pfi.14.1684220026570; Mon, 15 May 2023 23:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684220026; cv=none; d=google.com; s=arc-20160816; b=VQJU8THKfbcF23O99F2MpzjRTFvd948xlI3go+oEZZ9eiam9B6NxriNAu0LgIroPvH ksxkNSD2rwS5R16JIQ3AAcBaAD5oUCFd/v6Gg4WFWlEZ8hJ4WdJher72crU6MNg5s+gM +6NtPEeLS5I5I8AaLf1dDHY+u0DKpoE6gz4HzgAJqwbdEXFZLFEnw/3jhbmgfPEiJVjn eatrhNKpXW1ZhXygFzOY1TQzfNoF/VSvaOP5INiazp/6n1smRi4lwYTAu/tKj8h/cwHI I7AzOtDsdeGNBBDzOLsHBYQCQFcV0OqkxIzvLfTt7oWY9TbKuq9HYs43EckfkA1lL7uH hz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=b8IB1/vpurIHuYS7SsYK6zUnWftE8fSZ0kMzR0VBkJ8=; b=ke54hZhTD/rsEJd1eXW7W9kW3wwzVRzdVCjx8+/zO9649PO470qZ0uYD9WwyrV6ObG v632gMWgNKP/evwGzZg2h7oATbGwXtvxRzGJb4SPTqurujK23YXIhhuXF2xUf89vFTCE HHW+RAFE3SZ1S239JJLEeEq4C0ys8ytHGKaQeAqmZ18E3sHML406sLdRkei5NMu42XBg 1p5zEDgMSbkkphybEFklAktjOL6fogKc09gBlUMy/wUQt8lPd82oGHBMb2st96Z0q9CJ G0Cf9peHcH1JFnSBknSBgc/JLM7eiV+PYrFi4IGqxyEsntgNZ3OgoVU6FZoSdNrbP7iL Bx0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pupmp9bN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020aa79a12000000b006293f8330fcsi18498042pfj.322.2023.05.15.23.53.34; Mon, 15 May 2023 23:53:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pupmp9bN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbjEPGsY (ORCPT + 99 others); Tue, 16 May 2023 02:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229972AbjEPGsX (ORCPT ); Tue, 16 May 2023 02:48:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21B071FFA; Mon, 15 May 2023 23:48:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AA00A63465; Tue, 16 May 2023 06:48:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E8C4C433EF; Tue, 16 May 2023 06:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684219701; bh=R+bN+Jb2kJNplNYenuVF5QgSUK9IhdlaUvOPxPK/xz8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pupmp9bN4mIe64U2fo9F8UefKptAy5mWp6F7MRU+/TiwNMhQ++TKFwcOXaw5QdM94 1bj8pkiTr0h1CWYOZwnQXpccEoR7RAosqv2vPzU6IUNP+h7e5qiL+ZDjrz2vAG7UzJ M3HFj+J7Eg/kV7Hu/Xlfhr4Ox54CrH8ydp6Ifd7BtrsFr791FbjKjBqEtOikLh9qaB SEq/1clH/ih6m7ixI+finZ1REBz1JevfVLcF190KsO6fiagiAaJfYwKDO6CmSjNIYg 51OAK+Dnci+faVsBi+J9Uc/LAPw1JKOib7qFQiIp4unwCIRov8FmdZIOU4BUw+AY1X C5lCE6g3CjXpQ== Date: Tue, 16 May 2023 09:48:13 +0300 From: Mike Rapoport To: Baoquan He Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@aculab.com, shorne@gmail.com, willy@infradead.org, deller@gmx.de Subject: Re: [PATCH v5 RESEND 05/17] mm: ioremap: allow ARCH to have its own ioremap method definition Message-ID: References: <20230515090848.833045-1-bhe@redhat.com> <20230515090848.833045-6-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230515090848.833045-6-bhe@redhat.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 05:08:36PM +0800, Baoquan He wrote: > Architectures can be converted to GENERIC_IOREMAP, to take standard > ioremap_xxx() and iounmap() way. But some ARCH-es could have specific > handling for ioremap_prot(), ioremap() and iounmap(), than standard > methods. > > In oder to convert these ARCH-es to take GENERIC_IOREMAP method, allow > these architecutres to have their own ioremap_prot(), ioremap() and > iounmap() definitions. > > Signed-off-by: Baoquan He > Acked-by: Arnd Bergmann > Cc: linux-arch@vger.kernel.org > Cc: Kefeng Wang Reviewed-by: Mike Rapoport (IBM) > --- > include/asm-generic/io.h | 3 +++ > mm/ioremap.c | 4 ++++ > 2 files changed, 7 insertions(+) > > diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h > index a7ca2099ba19..39244c3ee797 100644 > --- a/include/asm-generic/io.h > +++ b/include/asm-generic/io.h > @@ -1081,11 +1081,14 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, > void iounmap(volatile void __iomem *addr); > void generic_iounmap(volatile void __iomem *addr); > > +#ifndef ioremap > +#define ioremap ioremap > static inline void __iomem *ioremap(phys_addr_t addr, size_t size) > { > /* _PAGE_IOREMAP needs to be supplied by the architecture */ > return ioremap_prot(addr, size, _PAGE_IOREMAP); > } > +#endif > #endif /* !CONFIG_MMU || CONFIG_GENERIC_IOREMAP */ > > #ifndef ioremap_wc > diff --git a/mm/ioremap.c b/mm/ioremap.c > index db6234b9db59..9f34a8f90b58 100644 > --- a/mm/ioremap.c > +++ b/mm/ioremap.c > @@ -46,12 +46,14 @@ void __iomem *generic_ioremap_prot(phys_addr_t phys_addr, size_t size, > return (void __iomem *)(vaddr + offset); > } > > +#ifndef ioremap_prot > void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size, > unsigned long prot) > { > return generic_ioremap_prot(phys_addr, size, __pgprot(prot)); > } > EXPORT_SYMBOL(ioremap_prot); > +#endif > > void generic_iounmap(volatile void __iomem *addr) > { > @@ -64,8 +66,10 @@ void generic_iounmap(volatile void __iomem *addr) > vunmap(vaddr); > } > > +#ifndef iounmap > void iounmap(volatile void __iomem *addr) > { > generic_iounmap(addr); > } > EXPORT_SYMBOL(iounmap); > +#endif > -- > 2.34.1 > > -- Sincerely yours, Mike.