Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp505192ybl; Wed, 8 Jan 2020 00:45:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxKam5HcpVS8gS3p5z32Z6B4lYvQowJtXyPGFN2rLA0iTU3dHZXLUjN0BgWqLg590wPxgwX X-Received: by 2002:aca:c0c5:: with SMTP id q188mr2050790oif.169.1578473123726; Wed, 08 Jan 2020 00:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578473123; cv=none; d=google.com; s=arc-20160816; b=c3uyT5PM9DI9W5Koag6/WI/XtdqE9p0W4crmokUWC568zXDjwayVAYOVAqouNsYT7t rocLYmmVzvTLdhc/tK/WoRz/ghWzBiqj4WLsVq2uUpGVBllOL7fn6BySEGFK3jhi2PPK h3IEjhTJFHUIjiC49YM+LjawuscD92F/0JSq27eKcBJ0aeYIJ51TxcuyrcU5qvHbbG9t VvF//iaItjUxP7ZzZ4jh+gB2HlYN7yyjsrug0t09x8lDbWDPYGbNoKdo7VG8k2Xh5G0E Ygs1U3vMrh6aR91gO7gJl+Im32E2QXbDexdOQAzxIbujePgC1i68I1lAPjaOGzskg94+ Rujw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qJ03BW9/OY55tK5g2EFyIiuZfKNQSI2fj/SuTqPwOQ0=; b=bACqqp2Zi/Yc/J/ZDWRD1+/N/urdXJv4DNzLZ5QWTdOiJii6LwqfIL9HV558G/kRCo mMhOb4LA2lg00YgstdBkzQYMWN5Rvwwv8yFs/r0rF5BSOnXVcLRAEz+Kz8Mj7lncIxHl vkFWYZFi50S+4xk3wMYL1vzKUkPRiO55QEpSh3ehX7DmF2auU8EAsikmY9YRtYzDWtme 5cFFA8b1fhJq8tpKLwIA4yHHQur/yLkAxtLMZwwncsHCnuD5ClH/vNzdLMedw8FTKHlF d8p4fvgEoYdALk/VlKd985nhYkLlO6PZo22tsoQ4rspaa1ZeRrT3jCWZUILp852/u4tn CPGg== ARC-Authentication-Results: i=1; mx.google.com; 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 l17si1498796oie.41.2020.01.08.00.45.12; Wed, 08 Jan 2020 00:45:23 -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; 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 S1727374AbgAHIo6 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 8 Jan 2020 03:44:58 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:52877 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbgAHIo6 (ORCPT ); Wed, 8 Jan 2020 03:44:58 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MfHMj-1jMEiy0Wjr-00gm0v; Wed, 08 Jan 2020 09:44:55 +0100 Received: by mail-qk1-f182.google.com with SMTP id a203so1957447qkc.3; Wed, 08 Jan 2020 00:44:54 -0800 (PST) X-Gm-Message-State: APjAAAX/HqfzxlmtV4x1U/fKGxAmv9rT/vfSvMM8DmSA2x3G6g5atz9c FEdHLPGupeYZbVYLaoyimUSYpqqYMug0lHm0vUo= X-Received: by 2002:a05:620a:a5b:: with SMTP id j27mr3333439qka.286.1578473093254; Wed, 08 Jan 2020 00:44:53 -0800 (PST) MIME-Version: 1.0 References: <1578415992-24054-1-git-send-email-krzk@kernel.org> <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> In-Reply-To: <2355489c-a207-1927-54cf-85c04b62f18f@c-s.fr> From: Arnd Bergmann Date: Wed, 8 Jan 2020 09:44:36 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFT 00/13] iomap: Constify ioreadX() iomem argument To: Christophe Leroy Cc: Krzysztof Kozlowski , Geert Uytterhoeven , 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 , ML nouveau , Dave Airlie , Matt Turner , arcml , Nick Kossifidis , Allen Hubbe , 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" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Provags-ID: V03:K1:QwaGXiRich5wImpYp8FQnHgp5kz2EKPSRExzga2LIzGLBfSa0WJ YnmgjVSYdk7STyuVgrutKdQc7aoKqByAaVnwi68AgQg3IFWh04Gh6pqjpKwH3m7wy2iRCA1 PvzHznSMskO2L/HVIAkGLVZhQ2nbXsMe5JX3qhXYDTaGmuCa8roKlNaJ8gtk4H96Hm0BIPI zBw/C+qVbQbtL0MIhk1oQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:UcFnSV1veRY=:yAYfQVlOazrC0OSa/xZ2Nn yp42v9FkRaF2KA4UJ3hjLCp/g9EzGQLUUTq//7jvX8/1CNRrXY8VT91084KTIyxk5Vs+EPryg aj2xlfhVVGolkKoUV/BYXQ1UzgTF+jRGGxmvzbPbwcRznWjbl/0+uRFH3IKIgZ3tHYMvGImty NSMXcL9iShsH5E6VqRg6pjGR2qpkRHXy7xlxlS++W6GEH/tAkTdr0W8n7scB8zJDHoFww+gm1 mtNLiJQNf7AvKEuJc1lc/zQM7FFsH7pzEpFfLHipJsUdUZez7aWC5PjeoaCPO0CYMAgP6aqIK t3ZuhjdM2x3mdYDPc4ytUKByu0kMK6SzuEgpSNsE1h1OBPNZIN/0iVEzl5a+CGrKarZpXA9NA fxBdYShqIjl5+TtpR1po0zbDoSVf+6imCQsw5j4oJxHcsgl1hiJ5mif+Sw+p+65ElTSANGZfz 3isHRrC0FZg7bZTy6rZsBC9Fh81yzVhvb8ut8Epv5wp+AyiNKbL+Dtsv8mrPCQ6CFVXCDQIIV K2m8Y4gxk0BomOAq4MJywrsw25fODcLK1jVRlwZuWuyNZ/SNtdEko4BaJb5ECWS3OM3qB9j06 RwjrEWLGO9an6mnuQqyFg8XcOq32zG5kYZphVInaxus9CsKlR2cxv7i8A9nB3LXmVBZXYxyHs Rx1ltzngDZdduOi0jQG/AVGiV6D/+uNwvPGg2VBVnufTIpjgMlYQhVohLhEZ4Ed+OAg6nB8uu LY2MUEZJYDPxl1zj4vm9pEQ9ulHV5pF3leUwNDwFRt+SLKh7CShdNt/xa4q8afWm/NAtMzk0F s9mraeWNkFoevqmtlU9H/+y6nNpPiZ6YfrT6GLSmJZVC1QU8R+9ystFFly9223I8kpFenpElw yHqdix5nJ7UFSyxlyduw== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Jan 8, 2020 at 9:36 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: > > 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." The I/O accessors are one of the few places in which 'volatile' generally makes sense, at least for the implementations that do a plain pointer dereference (probably none of the ones in question here). In case of readl/writel, this is what we do in asm-generic: static inline u32 __raw_readl(const volatile void __iomem *addr) { return *(const volatile u32 __force *)addr; } The __force-cast that removes the __iomem here also means that the 'volatile' keyword could be dropped from the argument list, as it has no real effect any more, but then there are a few drivers that mark their iomem pointers as either 'volatile void __iomem*' or (worse) 'volatile void *', so we keep it in the argument list to not add warnings for those drivers. It may be time to change these drivers to not use volatile for __iomem pointers, but that seems out of scope for what Krzysztof is trying to do. Ideally we would be consistent here though, either using volatile all the time or never. Arnd