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 92954C32774 for ; Tue, 23 Aug 2022 02:44:06 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RKTPxS1TD8KeRITFbXOJlu1WBFpa8ZZGB4cGqMRvMYU=; b=fxurf1ALBxEJb7 dcQh4PYvT87ETS/x33f0Y2d44wmgAWvVVpuflGI07nFUX9JUipcsGcshtG4SI43XgyCkPh4aP4s9Y yoXR4cUkxWg1tQCfVPqXafNl+cMo50iPI8m/1TOu9WMqUO136MRnS6UD7FerTrVJL1wsJZ8WQFMfW F4Cky1t39cG+3V4yXwpbLzBpuWenWhuODjzFxMYuMW1M6suDYJrlloeXS0BV7951eGd8yVC0/7N0J xKXgTpMjyA1gyhqGJPClzTAV7onOLjBNwzV8NUS/jqALq43EkBvbhv/+de0YGXOF1fZ53O51Hdc7G pOPe8SdPJ3SsQmjoXmmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQJsa-000l9l-Vy; Tue, 23 Aug 2022 02:43:01 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQJsV-000l0L-VS for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 02:42:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661222573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YgbO8iFV6P0Cia6+3yhw+UCHidRLj9zT3dgvk0gufSI=; b=StAsM2OZzPqoI83hBNGKIFcsc4RLzI/vq955buAhx1A9g20Zwx7rdLfTiMJekc27zp8o+x mAgs1LodJfyD66T6aogdv2flSBbtRA9lnuxg2I5a0zEQWB/MhLEZuSu8u8LyFcVYCU9v6I tTSkuBugcfPO5Kdel0ZJyuiokdVESKU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-628-h3Fs69brOC2KXtLqff6kzw-1; Mon, 22 Aug 2022 22:42:50 -0400 X-MC-Unique: h3Fs69brOC2KXtLqff6kzw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 283A13C01E12; Tue, 23 Aug 2022 02:42:50 +0000 (UTC) Received: from localhost (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5017D492C3B; Tue, 23 Aug 2022 02:42:48 +0000 (UTC) Date: Tue, 23 Aug 2022 10:42:44 +0800 From: Baoquan He To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 03/11] mm: ioremap: allow ARCH to have its own ioremap definition Message-ID: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-4-bhe@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220822_194256_318848_E217ACD9 X-CRM114-Status: GOOD ( 17.60 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 08/20/22 at 11:57pm, Christoph Hellwig wrote: > On Sat, Aug 20, 2022 at 08:31:17AM +0800, Baoquan He wrote: > > Architectures like xtensa, arc, can be converted to GENERIC_IOREMAP, > > to take standard ioremap_prot() and ioremap_xxx() way. But they have > > ARCH specific handling for ioremap() method, than standard ioremap() > > method. > > Do they? > > For arc, the arc_uncached_addr_space case can be easily handled by > arch_ioremap, and the xtensa case looks very similar to that. I am worried it will impact ioremap_prot(). Arc has selected HAVE_IOREMAP_PROT in Kconfig. Putting arc_uncached_addr_space() calling into arch_ioremap() will change ioremap_prot(), right? And I have the same about xtensa. You can see ioremap() and ioremap_cache() will return different value since they take XCHAL_KIO_BYPASS_VADDR and XCHAL_KIO_CACHED_VADDR differently. I haven't figured out a way to handle them in arch_ioremap() differently. static inline void __iomem *ioremap(unsigned long offset, unsigned long size) { if (offset >= XCHAL_KIO_PADDR && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR); else return xtensa_ioremap_nocache(offset, size); } static inline void __iomem *ioremap_cache(unsigned long offset, unsigned long size) { if (offset >= XCHAL_KIO_PADDR && offset - XCHAL_KIO_PADDR < XCHAL_KIO_SIZE) return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR); else return xtensa_ioremap_cache(offset, size); } > > I'd really like to kill off arch definitions of ioremap going > forward, as they should just be a special case of ioremap_prot > by definition. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel