Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561AbdFVVDW (ORCPT ); Thu, 22 Jun 2017 17:03:22 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:33643 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271AbdFVVDS (ORCPT ); Thu, 22 Jun 2017 17:03:18 -0400 MIME-Version: 1.0 In-Reply-To: <401cdb64-6fdb-be30-b8bc-bf51c1a35074@deltatee.com> References: <20170622164817.25515-1-logang@deltatee.com> <20170622164817.25515-5-logang@deltatee.com> <20170622210828.27304f6a@alans-desktop> <401cdb64-6fdb-be30-b8bc-bf51c1a35074@deltatee.com> From: Arnd Bergmann Date: Thu, 22 Jun 2017 23:03:17 +0200 X-Google-Sender-Auth: lpUJGjg_o3z3-7Vve_sKrLRxx9k Message-ID: Subject: Re: [PATCH 4/7] alpha: provide ioread64 and iowrite64 implementations To: Logan Gunthorpe Cc: Alan Cox , Linux Kernel Mailing List , linux-arch , linux-ntb@googlegroups.com, linux-alpha@vger.kernel.org, linuxppc-dev , linux-crypto@vger.kernel.org, dri-devel , Greg Kroah-Hartman , Stephen Bates , Richard Henderson , Ivan Kokshaysky , Matt Turner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1001 Lines: 23 On Thu, Jun 22, 2017 at 10:09 PM, Logan Gunthorpe wrote: > On 6/22/2017 2:08 PM, Alan Cox wrote: >> >> But this does not do the same thing as an ioread64 with regards to >> atomicity or side effects on the device. The same is true of the other >> hacks. You either have a real 64bit single read/write from MMIO space or >> you don't. You can't fake it. > > > Yes, I know. But is it not better than having every driver that wants to use > these functions fake it themselves? Drivers that want a non-atomic variant should include either include/linux/io-64-nonatomic-hi-lo.h or include/linux/io-64-nonatomic-lo-hi.h depending on what they need. Drivers that require 64-bit I/O should probably just depend on CONFIG_64BIT and maybe use readq/writeq. I see that there are exactly two drivers calling ioread64/iowrite64: drivers/crypto/caam/ is architecture specific and drivers/ntb/hw/intel/ntb_hw_intel.c already has a workaround that should make it build on alpha. Arnd