Received: by 10.213.65.68 with SMTP id h4csp1537005imn; Mon, 26 Mar 2018 09:24:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fOiqiB3Qk0QQHTiMmCyXuccCW4xGco3I43Qq4JxT7n47Ubxjt8CnG7QyWBx5qvXEx8j9T X-Received: by 10.99.149.83 with SMTP id t19mr3621053pgn.433.1522081479029; Mon, 26 Mar 2018 09:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522081478; cv=none; d=google.com; s=arc-20160816; b=07cb09qeZdW5nXz69JVsXRuv1qZhoF7oaItrok3igVXxT3/WJB8QkVr+H2aUt0CmJU 4Fi33Oy54DOnTpyvmTgm/3x4PWddodDi5ekMCav5xpTZqNw9kPWZ3P/+JfA+nGNaTMg5 4XQh8X/FRy+XqlSvjjPq8XB2i4Ot8TKnTy/Z2lnnZ/WkZISV8cGKNuE73Fu+5pVhnq8j ctTiIVopWxto3Sx9LQiiFr6CLyWPIiMVK49qf0ZTU1W5dTnrmF/ISZ7/bljLh8SHoh2I TW43M24Q1baRQhVkkllD2dsF4V4DQeGX/ZmEg5K8TzlwaF7nsNNKLWCyqMNi1hAGY7JM 7xug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=4G3onaJBCdwQH/tWWIkRlu7iOoWZ0pIsYxvG6lX+zEM=; b=OJEt2S5OeBycqdUB+9hCYW0GuKKhXUxWz4P4Z+FSoiHFzlF3a14fd3ucnyGJbHJMso rH5gtikJ+FMFPceyzIR0GhgNIp+pzcGuGXtOTN3XPa6M6CEIfbxIfY8cZLsj5/W1R3Q7 DZfuk7YkHT6gr1gGUEXOa2JEj5etN0/iL0iU8as8E1oinkoAraeHCart52BEUhF7vN+G 22CSyBPpIQ/c8sqf0NEwYB95aIKIhUE/ewNFcXwksNfhj0SvqCVIStK9ciMzS3imM20J P60nklalYw3JmyojrRbHz3GI4Fb/G08oQj6spJ6CYUbUk6iOaN3eCjSVrAyQzjrkNh6Q oxyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 u72si10417411pgc.545.2018.03.26.09.24.23; Mon, 26 Mar 2018 09:24:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752536AbeCZQV5 (ORCPT + 99 others); Mon, 26 Mar 2018 12:21:57 -0400 Received: from ale.deltatee.com ([207.54.116.67]:58936 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752459AbeCZQVz (ORCPT ); Mon, 26 Mar 2018 12:21:55 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1f0UsT-0001GL-I6; Mon, 26 Mar 2018 10:21:46 -0600 To: Arnd Bergmann Cc: Linux Kernel Mailing List , linux-arch , linux-ntb@googlegroups.com, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Greg Kroah-Hartman , Andy Shevchenko , =?UTF-8?Q?Horia_Geant=c4=83?= , Philippe Ombredanne , Thomas Gleixner , Kate Stewart , Luc Van Oostenryck References: <20180321163745.12286-1-logang@deltatee.com> <20180321163745.12286-2-logang@deltatee.com> From: Logan Gunthorpe Message-ID: <726eb143-2cca-b221-b569-e193a962e357@deltatee.com> Date: Mon, 26 Mar 2018 10:21:43 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: luc.vanoostenryck@gmail.com, kstewart@linuxfoundation.org, tglx@linutronix.de, pombredanne@nexb.com, horia.geanta@nxp.com, andy.shevchenko@gmail.com, gregkh@linuxfoundation.org, linux-crypto@vger.kernel.org, linux-ntb@googlegroups.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v13 01/10] iomap: Use correct endian conversion function in mmio_writeXXbe X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/03/18 04:53 AM, Arnd Bergmann wrote: > On most architectures, this is not important: > - For x86, the stores are aways atomic and no additional barriers > are needed, so the two are the same > - For ARM (both 32 and 64-bit), powerpc and many others, we don't > use the generic iowrite() and just fall back to writel() or > writel(swab32()). > > However, shouldn't we just use the writel(swab32()) logic here as well > for the common case rather than risking missing barriers? Hmm, I don't know... it's complicated? Doing a bit of digging shows that the existing code was written during a time when writel() did not include extra barriers over __raw_writel() in any of the common arches. The commit logs don't seem to provide any guidance as to why this it was done this way, but I'd assume it was done to avoid a double swab() call on BE arches. Seeing writel() is typically implemented as: __raw_writel(__cpu_to_le32(value), addr); Then on BE arches, writel(swab32()) would become: __raw_writel(swab32(swab32(value)), addr) Which seems undesirable. Logan