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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBBCEC4360F for ; Mon, 18 Feb 2019 20:30:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AAC1F20661 for ; Mon, 18 Feb 2019 20:30:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbfBRUaK (ORCPT ); Mon, 18 Feb 2019 15:30:10 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:49421 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfBRUaK (ORCPT ); Mon, 18 Feb 2019 15:30:10 -0500 X-Originating-IP: 141.70.45.131 Received: from localhost (hadi-gate-vlan-851.hadiko.whka.de [141.70.45.131]) (Authenticated sender: hle@owl.eu.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A37FD240008; Mon, 18 Feb 2019 20:30:07 +0000 (UTC) Date: Mon, 18 Feb 2019 21:30:07 +0100 From: Hugo Lefeuvre To: Arnd Bergmann Cc: Thomas Gleixner , linux-arch , Linux Kernel Mailing List Subject: Re: [PATCH 0/4] iomap: fix multiple consistency issues, interface cleanup Message-ID: <20190218203007.GB18457@behemoth.owl.eu.com.local> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Nice cleanup! Applied to my asm-generic tree now. Thanks! > I notice that you did not add a 'volatile' qualifier in addition to 'const'. > Is that something you considered doing? I think the traditional > readl/writel style accessors have them partly for historic reasons, > and partly to simply the trivial implementation that is based on > a volatile pointer dereference. Neither is needed here, and I don't > think we have any drivers that pass volatile pointers into ioread()/iowrite() > (which would cause a warning), so we can probably leave it at that, > but it's still a bit inconsistent. Right, I intentionally omitted the volatile qualifier here. Adding it to the definitions from asm-generic/iomap.h would require to also update lib/iomap.c and arch/ implementations. This should, imo, only be done if really necessary. >From what I've seen, almost all ioread() implementations simply redirect to readl style accessors. I could not find one implementation that does something with the addr argument which requires the volatile qualifier. Also, I'm not even sure to understand why we need the volatile qualifier in the ioread() definitions from asm-generic/io.h... Drivers wishing to pass volatile pointers to ioread() should probably use a more low level api. regards, Hugo -- Hugo Lefeuvre (hle) | www.owl.eu.com RSA4096_ 360B 03B3 BF27 4F4D 7A3F D5E8 14AA 1EB8 A247 3DFD ed25519_ 37B2 6D38 0B25 B8A2 6B9F 3A65 A36F 5357 5F2D DC4C