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 56EEEC28D13 for ; Tue, 23 Aug 2022 01:20:35 +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=Ttfc3zQcCnj83M1lgegm+X/YCrbtmADREl3/axmsuTM=; b=2d0sQbbb2wc23l mlzo1A2JiGIK32cnhqngFlhaMyX+BNM49naWL4liRg4A6JlOXZ9nUiXfE5XSoNgrfQif7TUdSnn9b bMBh/KEs4+32sOtH+AWROEuuYW4/NrD0jRYTZQTdVz95i6cNe0w2Jo4xv85r436KTvfNFBNI47+nS LgZgQ1LKGmKvxhUdwHYdUDkQdxE7G00YYxDl8hvWF6FnItw68+KpaJMq/iqgtxicrkdtB2XYFokOF 7gibqKVAGsuRfMME/ArcLP5J6I9g4L5zk0jmm4lK/mzug7MzNhl+zej/2sDc1nXWKSUTtqY0Z2u/B eko0EBtix5O2IfaL/PfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQIZg-00H96q-GU; Tue, 23 Aug 2022 01:19:24 +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 1oQIZa-00H91R-G6 for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 01:19:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661217557; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CW2EFXmVRUt9BFAcUrpKBhy5C51otkLjmqsQzxzTVC0=; b=AP56FeDlcKPRAoQeAZ/BrTuqPwcFTvVIHNEI/QCDe3flR0jYxZ5kpHoqcIkzJSJoPsheXK Y8C0EU5EKHuVTsxe36GTApuQ33dYF+GgVBOLX65k2Qf3WXV83VFDjwaHsSTLQfeNPQuHvk vTAOUDLdRzlRrYDSrtzafNCQRpkIGL8= 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-636-FAm2T8xXOvKveTwz3C7yew-1; Mon, 22 Aug 2022 21:19:14 -0400 X-MC-Unique: FAm2T8xXOvKveTwz3C7yew-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 83D9D3C01E12; Tue, 23 Aug 2022 01:19:13 +0000 (UTC) Received: from localhost (ovpn-12-31.pek2.redhat.com [10.72.12.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4AD202026D4C; Tue, 23 Aug 2022 01:19:11 +0000 (UTC) Date: Tue, 23 Aug 2022 09:19:07 +0800 From: Baoquan He To: Christophe Leroy Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "hch@infradead.org" , "agordeev@linux.ibm.com" , "wangkefeng.wang@huawei.com" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2 02/11] mm: ioremap: fixup the physical address and page prot Message-ID: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-3-bhe@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220822_181919_235601_66622EED X-CRM114-Status: GOOD ( 19.53 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 08/22/22 at 06:30am, Christophe Leroy wrote: > = > = > Le 20/08/2022 =E0 02:31, Baoquan He a =E9crit=A0: > > On some architectures, the physical address need be fixed up before > > doing mapping, e.g, parisc. And on architectures, e.g arc, the > > parameter 'prot' passed into ioremap_prot() need be adjusted too. > > = > > In oder to convert them to take GENERIC_IOREMAP method, we need wrap > > the address fixing up code and page prot adjusting code into arch_iorem= ap() > > and pass the new address and 'prot' out for ioremap_prot() handling. > = > Is it really the best approach ? Wouldn't it be better to have helpers = > to do that, those helpers being called by the ioremap_prot(), instead of = > doing it inside the arch_ioremap() function ? This is suggested too by Alexander during his v1 reviewing. I tried, but feel the current way taken in this patchset is better. Because not all architecutres need the address fix up, only parisc, and only few need adjust the 'prot'. Introducing other helpers seems too much, that only increases the complexity of of ioremap() and the generic GENERIC_IOREMAP method for people to understand and take. > = > > = > > This is a preparation patch, no functionality change. > = > Could this be squashed into previous patch ? Yep, will do. Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel