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 D6E4AECAAD5 for ; Sun, 28 Aug 2022 14:45:52 +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=tkxwdulEiBZ7rbNWpWNxmcgFK+8NX16duv898qp3PyA=; b=v0xCD7A/IB7LNn s7AOirwa6m3VttEe87e5tddbGw2RABuD/F9w13z56iCX50riRZC5wusKCw6cd54BKfkBxYzY4L7Z+ 65G5qG+jZJ+9tLGes2p0DWLMW8qU2XdBEwAcxPuhjjBp8ZoQXqPoemyrZXl0D8tlfLx3zT/CeHU5U 28Xps/y/QtMqdPgXc1jiJXJJtte0LViYqdH+IAskhEuhdi6JOW3LLpNXuXmAxromFB//Jr4XTW0jg KsKsuQp8yOlWTqxJTHHsx5pEWh2rCZ0OHpTteSODIkfoZNOp7ALLjR1WjZzFYzsyquAF5ZC71/NSf p3L8V46hWXmdG7Qv98UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oSJWo-0000ZP-En; Sun, 28 Aug 2022 14:44:46 +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 1oSJWk-0000X1-CI for linux-arm-kernel@lists.infradead.org; Sun, 28 Aug 2022 14:44:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661697881; 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=hTdmiB22wnq3dmvK7RjNhZhCqkVHrOk+1i/pQcMS7HE=; b=ERjO6UG2DpUmxwhH33kS4Q99jGeJzC6vUXmiAvmLPevCUl1VRxc2FGhuzsQILrpAk2dxKp Y6hgwwVhi9McaIi6Sx6MED/6yCISg69Q0M35EYkwB+/PyEmTP+w8wUL3nTJdeotOR9HMhX AVYtDvWgdgRLPPifXRran5/6F5n+bRo= 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-660-_VW9_-tSOkiUcRiPCEVYfA-1; Sun, 28 Aug 2022 10:44:36 -0400 X-MC-Unique: _VW9_-tSOkiUcRiPCEVYfA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8858F1C051AF; Sun, 28 Aug 2022 14:44:35 +0000 (UTC) Received: from localhost (ovpn-12-25.pek2.redhat.com [10.72.12.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD2B94C816; Sun, 28 Aug 2022 14:44:32 +0000 (UTC) Date: Sun, 28 Aug 2022 22:44:28 +0800 From: Baoquan He To: David Laight Cc: 'Christophe Leroy' , "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 01/11] mm/ioremap: change the return value of io[re|un]map_allowed and rename Message-ID: References: <20220820003125.353570-1-bhe@redhat.com> <20220820003125.353570-2-bhe@redhat.com> <429cb367-923f-bb3d-ccf0-57dce0c7f35b@csgroup.eu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220828_074442_570524_8B5847DA X-CRM114-Status: GOOD ( 31.49 ) 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 Hi David, On 08/24/22 at 08:16am, David Laight wrote: ...... > > >>>> Le 20/08/2022 =E0 02:31, Baoquan He a =E9crit=A0: > > >>>>> In some architectures, there are ARCH specifici io address mapping > > >>>>> handling when calling ioremap() or ioremap_prot(), e.g, arc, ia64, > > >>>>> openrisc, s390, sh. > > >>>>> > > >>>>> In oder to convert them to take GENERIC_IOREMAP method, we need c= hange > > >>>>> the return value of hook ioremap_allowed() and iounmap_allowed(). > > >>>>> Meanwhile, rename them to arch_ioremap() and arch_iounmap() to re= flect > > >>>>> their current behaviour. > > >>> > > >>> Thanks for reviewing. > > >>> > > >>>> > > >>>> Please don't just say you need to change the return value. Explain= why. > > >>> > > >>> The 1st paragraph and the sentence 'In oder to convert them to take > > >>> GENERIC_IOREMAP method' tell the reason, no? > > >> > > >> What I would like to read is _why_ you need to change the return val= ue > > >> in order to convert to GENERIC_IOREMAP > > > > > > I rephrase the log as below, it's OK to you? Or please help check and > > > tell what I need to improve to better explain the reason. > > > > > > =3D=3D=3D=3D > > > The current io[re|un]map_allowed() hooks are used to check if the > > > io[re|un]map() actions are qualified to proceed when taking > > > GENERIC_IOREMAP way to do ioremap()/iounmap(). Otherwise io[re|un]map= () > > > will return NULL. > > > > > > On some architectures like arc, ia64, openris, s390, sh, there are > > > ARCH specific io address mapping to translate the passed in physical > > > address to io address when calling ioremap(). In order to convert > > > these architectures to take GENERIC_IOREMAP way to ioremap(), we need > > > change the return value of hook ioremap_allowed() and iounmap_allowed= (). > > > With the change, we can move the architecture specific io address > > > mapping into ioremap_allowed() hook, and give the mapped io address > > > out to let ioremap_prot() return it. While at it, rename the hooks to > > > arch_ioremap() and arch_iounmap() to reflect their new behaviour. > > > =3D=3D=3D=3D > > > > > = > > That looks more in line with the type of explanation I foresee in the > > commit message, thanks. > = > I think you also need to summarise the change itself. > If the success/fail return actually changes then you really > need to change something so the compiler errors unchanged code. > Otherwise it is a complete recipe for disaster. Thanks for looking into this and sorry for late response. I am not sure if I follow you. In this patch, I just rename the old ioremap_allowed() to arch_ioremap(), and change its return value. Except of arm64 which has taken GENERIC_IOREMAP way to provide ioremap_allowed(), no other ARCHes are affected yet. This is what have been changed. Could you be more specific what I should add? Or are you suggesting words like below sentences need be added to patch log? If the success/fail return actually changes then you really need to change something so the compiler errors unchanged code. Otherwise it is a complete recipe for disaster. Thanks Baoquan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel