From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57CDFC433EF for ; Fri, 20 May 2022 01:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344471AbiETBXM (ORCPT ); Thu, 19 May 2022 21:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344503AbiETBW6 (ORCPT ); Thu, 19 May 2022 21:22:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D0162EA36 for ; Thu, 19 May 2022 18:22:27 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L487L0n8Pz1JCFf; Fri, 20 May 2022 09:21:02 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 09:22:25 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 09:22:24 +0800 Message-ID: Date: Fri, 20 May 2022 09:22:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap() Content-Language: en-US To: Andrew Morton CC: , , , , , , , References: <20220519082552.117736-1-wangkefeng.wang@huawei.com> <20220519082552.117736-5-wangkefeng.wang@huawei.com> <20220519115210.a6e41d5a997921354400557e@linux-foundation.org> From: Kefeng Wang In-Reply-To: <20220519115210.a6e41d5a997921354400557e@linux-foundation.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/5/20 2:52, Andrew Morton wrote: > On Thu, 19 May 2022 16:25:50 +0800 Kefeng Wang wrote: > >> Add special hook for architecture to verify or setup addr, size >> or prot when ioremap() or iounmap(), which will make the generic >> ioremap more useful. >> >> arch_ioremap() return a pointer, >> - IS_ERR means return an error >> - NULL means continue to remap >> - a non-NULL, non-IS_ERR pointer is directly returned >> arch_iounmap() return a int value, >> - 0 means continue to vunmap >> - error code means skip vunmap and return directly >> >> ... >> >> --- a/include/asm-generic/io.h >> +++ b/include/asm-generic/io.h >> @@ -964,6 +964,30 @@ static inline void iounmap(volatile void __iomem *addr) >> #elif defined(CONFIG_GENERIC_IOREMAP) >> #include >> >> +/* >> + * Arch code can implement the following two special hooks when using GENERIC_IOREMAP >> + * arch_ioremap() return a pointer, >> + * - IS_ERR means return an error >> + * - NULL means continue to remap >> + * - a non-NULL, non-IS_ERR pointer is returned directly >> + * arch_iounmap() return a int, >> + * - 0 means continue to vunmap >> + * - error code means skip vunmap and return directly >> + */ >> +#ifndef arch_ioremap >> +static inline void __iomem *arch_ioremap(phys_addr_t phys_addr, size_t size, unsigned long prot) >> +{ >> + return NULL; >> +} > Maybe should do > > #define arch_ioremap arch_ioremap > > here > >> +#endif >> + >> +#ifndef arch_iounmap >> +static inline int arch_iounmap(void __iomem *addr) >> +{ >> + return 0; >> +} > and here. > > It shouldn't matter a lot because this file has inclusion guards. > However it seems tidier and perhaps other code will want to know > whether this was defined. Dunno. > Oh, forget to add the define part, thanks Andrew. Hi Catalin, could you help to involve them when taking them, many thanks. > Otherwise, > > Acked-by: Andrew Morton > > Please take this patch and [2/6] and [3/6] via the appropriate arm tree. > > . From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEDE6C433EF for ; Fri, 20 May 2022 01:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yQDdD5RRg7w+b0fCYog2KddSQ+KFIzXl1S/0tLgr/uk=; b=SitoUgVHS12ojD sdXF4HT7BfAmX5CeFSR8rVMv9f1O0R0JeSaUcbSVXXc12Dxp4dp3RCbmuIYSUZkncEt3JenPiNyCN l66JL0Y137n9ILtUTJt+oqiMOQ+yjXpEJR7qSKvltXtg+MYnJPKZzhOnXoD2cwh3Q/uP3lMeSdW9l m+JjE/WaGOYYEs+HQ9wNGUOMBCZrhUuUSRoNWtlaxEFi7MpLlw6KPEUOnd66le51w3+NASZlv/GGX mZttbqQyWQQLbuOMLke7mC6Qe/YewTJzkT3nUP34LKM3TGW5heLOIUPInV3ukQLiVu+1msHi/NkVA +UcsPjtRXO/i2JmFPciA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrrLd-009wmS-BT; Fri, 20 May 2022 01:22:33 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nrrLZ-009wkf-7Z for linux-arm-kernel@lists.infradead.org; Fri, 20 May 2022 01:22:31 +0000 Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L487L0n8Pz1JCFf; Fri, 20 May 2022 09:21:02 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 09:22:25 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 20 May 2022 09:22:24 +0800 Message-ID: Date: Fri, 20 May 2022 09:22:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH v3 4/6] mm: ioremap: Add arch_ioremap/iounmap() Content-Language: en-US To: Andrew Morton CC: , , , , , , , References: <20220519082552.117736-1-wangkefeng.wang@huawei.com> <20220519082552.117736-5-wangkefeng.wang@huawei.com> <20220519115210.a6e41d5a997921354400557e@linux-foundation.org> From: Kefeng Wang In-Reply-To: <20220519115210.a6e41d5a997921354400557e@linux-foundation.org> X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220519_182229_514109_6E00550A X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2022/5/20 2:52, Andrew Morton wrote: > On Thu, 19 May 2022 16:25:50 +0800 Kefeng Wang wrote: > >> Add special hook for architecture to verify or setup addr, size >> or prot when ioremap() or iounmap(), which will make the generic >> ioremap more useful. >> >> arch_ioremap() return a pointer, >> - IS_ERR means return an error >> - NULL means continue to remap >> - a non-NULL, non-IS_ERR pointer is directly returned >> arch_iounmap() return a int value, >> - 0 means continue to vunmap >> - error code means skip vunmap and return directly >> >> ... >> >> --- a/include/asm-generic/io.h >> +++ b/include/asm-generic/io.h >> @@ -964,6 +964,30 @@ static inline void iounmap(volatile void __iomem *addr) >> #elif defined(CONFIG_GENERIC_IOREMAP) >> #include >> >> +/* >> + * Arch code can implement the following two special hooks when using GENERIC_IOREMAP >> + * arch_ioremap() return a pointer, >> + * - IS_ERR means return an error >> + * - NULL means continue to remap >> + * - a non-NULL, non-IS_ERR pointer is returned directly >> + * arch_iounmap() return a int, >> + * - 0 means continue to vunmap >> + * - error code means skip vunmap and return directly >> + */ >> +#ifndef arch_ioremap >> +static inline void __iomem *arch_ioremap(phys_addr_t phys_addr, size_t size, unsigned long prot) >> +{ >> + return NULL; >> +} > Maybe should do > > #define arch_ioremap arch_ioremap > > here > >> +#endif >> + >> +#ifndef arch_iounmap >> +static inline int arch_iounmap(void __iomem *addr) >> +{ >> + return 0; >> +} > and here. > > It shouldn't matter a lot because this file has inclusion guards. > However it seems tidier and perhaps other code will want to know > whether this was defined. Dunno. > Oh, forget to add the define part, thanks Andrew. Hi Catalin, could you help to involve them when taking them, many thanks. > Otherwise, > > Acked-by: Andrew Morton > > Please take this patch and [2/6] and [3/6] via the appropriate arm tree. > > . _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel