Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp507889ybl; Wed, 8 Jan 2020 00:49:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzx2Jyd643og098WreUKNeKL9B8vunjrOrfurUjYhj9xrcbTgZYkZtLNpqdhJZrIWKg+M5/ X-Received: by 2002:a05:6808:aa8:: with SMTP id r8mr2058082oij.7.1578473371007; Wed, 08 Jan 2020 00:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578473370; cv=none; d=google.com; s=arc-20160816; b=wACa3/3q85R0x1Dv4ORFP8Fh7VvbfF2T5EcHDd2fS6Y4JYl2XwsGygeze9u1x+ZNiW hTrRD/zw6vNKkiIShV/6+6SS3lTEtMO+9e+c+89z5w+zKLpMKRMTFXN34LYT80hdp7wT TthyYd9RdJUW1dFMCW5sYsWlxAdac492DN7VFLHZHleuCmNwi0y6sKObYaO4Dm+BPOwX x9396Rg5gmauDkqHQn9Tl8JTMQ+I9pTjpGGkJSZJEqfEEaNmoZEWxt4yvQdaxJdCmr1Z FM9C+uiYzhpk5SuR6bK2lizKlXCpPt7SeinXEubncB48+5/ybLCjulLJx7PHBPNw4D4g 0aCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=kWCAIl6qlr/NQhjX84pOmCSHzIhFMSBDwvFc83ztIuI=; b=ThBK7Eu1izfdQ7FTFyc6DtKsfRGLvQJqS9Az2QmCtfWh5tcPBiCX/VqD0H978FD+2V iSI6IFqGZyTOSJBxxvKLwY8xdaM5qOA+s7Ojw+HoGCCSpGEGyN5A4XHyljNxGInljxoq DY0naCQqBVpHCoWo28rfVr58xuwxiSbAMbgkBFpHRHj1Rr/+84Ca12Z/XGHccIPHyDuE iMf+cT4teQPxzqdxNmyvmpPqAaRRj8Grm+1k4CaLgMLqFmpsi4qSYXp7tBvi34ASe3dK IVL8I5dDw+uAUlb1buqRPAqgR/WGi0HmiR2z8wlQeMFDmsHV/pkEpwVbegAetwXP8HUl xEQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Cd0z8iC9; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si1477211otp.109.2020.01.08.00.49.20; Wed, 08 Jan 2020 00:49:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Cd0z8iC9; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727476AbgAHIsv (ORCPT + 99 others); Wed, 8 Jan 2020 03:48:51 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:9734 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727313AbgAHIsu (ORCPT ); Wed, 8 Jan 2020 03:48:50 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 47t2wF6zpLz9v3Hd; Wed, 8 Jan 2020 09:48:45 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=Cd0z8iC9; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id eHCnKMUwPC8j; Wed, 8 Jan 2020 09:48:45 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47t2wF5Z8xz9v3Hc; Wed, 8 Jan 2020 09:48:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1578473325; bh=kWCAIl6qlr/NQhjX84pOmCSHzIhFMSBDwvFc83ztIuI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Cd0z8iC9RC8pjwPeyNjKHDYp8ooejNu3HGALPmb6+R1rGPni1Gqd3Osr1pzBr++DW qVroJ655pO9/GIgcKq73QC5BW2ualhxp5CandPHCNUTG1TbQ4ytfyemBB8YchvhikW Jys4zIMmlSAmxqdhihc3mS1nPdn3QvL04p1qUK10= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BCA2B8B7ED; Wed, 8 Jan 2020 09:48:46 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Z-k90vSTB5Ao; Wed, 8 Jan 2020 09:48:46 +0100 (CET) Received: from [172.25.230.100] (po15451.idsi0.si.c-s.fr [172.25.230.100]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2CC498B7EA; Wed, 8 Jan 2020 09:48:46 +0100 (CET) Subject: Re: [RFT 00/13] iomap: Constify ioreadX() iomem argument To: Geert Uytterhoeven Cc: Krzysztof Kozlowski , Rich Felker , Jiri Slaby , "Michael S. Tsirkin" , David Airlie , Jason Wang , DRI Development , virtualization@lists.linux-foundation.org, "James E.J. Bottomley" , netdev , Paul Mackerras , Linux-Arch , Dave Jiang , Yoshinori Sato , Helge Deller , Linux-sh list , Alexey Brodkin , Ben Skeggs , nouveau@lists.freedesktop.org, Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , Arnd Bergmann , alpha , Ivan Kokshaysky , Thomas Gleixner , Mauro Carvalho Chehab , Kalle Valo , Richard Henderson , Parisc List , Vineet Gupta , linux-wireless , Linux Kernel Mailing List , Luis Chamberlain , Daniel Vetter , Jon Mason , linux-ntb@googlegroups.com, Andrew Morton , Linux Media Mailing List , linuxppc-dev , "David S. Miller" References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> From: Christophe Leroy Message-ID: <00a43e5c-0708-d49a-9cc4-eb2ce8b4cf99@c-s.fr> Date: Wed, 8 Jan 2020 09:48:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi Geert, Le 08/01/2020 à 09:43, Geert Uytterhoeven a écrit : > Hi Christophe, > > On Wed, Jan 8, 2020 at 9:35 AM Christophe Leroy wrote: >> Le 08/01/2020 à 09:18, Krzysztof Kozlowski a écrit : >>> On Wed, 8 Jan 2020 at 09:13, Geert Uytterhoeven wrote: >>>> On Wed, Jan 8, 2020 at 9:07 AM Geert Uytterhoeven wrote: >>>>> On Tue, Jan 7, 2020 at 5:53 PM Krzysztof Kozlowski wrote: >>>>>> The ioread8/16/32() and others have inconsistent interface among the >>>>>> architectures: some taking address as const, some not. >>>>>> >>>>>> It seems there is nothing really stopping all of them to take >>>>>> pointer to const. >>>>> >>>>> Shouldn't all of them take const volatile __iomem pointers? >>>>> It seems the "volatile" is missing from all but the implementations in >>>>> include/asm-generic/io.h. >>>> >>>> As my "volatile" comment applies to iowrite*(), too, probably that should be >>>> done in a separate patch. >>>> >>>> Hence with patches 1-5 squashed, and for patches 11-13: >>>> Reviewed-by: Geert Uytterhoeven >>> >>> I'll add to this one also changes to ioreadX_rep() and add another >>> patch for volatile for reads and writes. I guess your review will be >>> appreciated once more because of ioreadX_rep() >> >> volatile should really only be used where deemed necessary: >> >> https://www.kernel.org/doc/html/latest/process/volatile-considered-harmful.html >> >> It is said: " ... accessor functions might use volatile on >> architectures where direct I/O memory access does work. Essentially, >> each accessor call becomes a little critical section on its own and >> ensures that the access happens as expected by the programmer." > > That is exactly the use case here: all above are accessor functions. > > Why would ioreadX() not need volatile, while readY() does? > My point was: it might be necessary for some arches and not for others. And as pointed by Arnd, the volatile is really only necessary for the dereference itself, should the arch use dereferencing. So I guess the best would be to go in the other direction: remove volatile keyword wherever possible instead of adding it where it is not needed. Christophe