From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751747AbdF1QDQ (ORCPT ); Wed, 28 Jun 2017 12:03:16 -0400 Received: from ale.deltatee.com ([207.54.116.67]:46704 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbdF1QDG (ORCPT ); Wed, 28 Jun 2017 12:03:06 -0400 To: Arnd Bergmann References: <20170627230204.16410-1-logang@deltatee.com> <20170627230204.16410-2-logang@deltatee.com> Cc: Linux Kernel Mailing List , linux-arch , linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org, Greg Kroah-Hartman , Jyri Sarha , Stephen Bates , Christoph Hellwig , Alan Cox From: Logan Gunthorpe Message-ID: Date: Wed, 28 Jun 2017 10:02:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: gnomes@lxorguk.ukuu.org.uk, hch@lst.de, sbates@raithlin.com, jsarha@ti.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 Subject: Re: [PATCH v2 1/3] io-64-nonatomic: add io{read|write}64[be] macros X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/06/17 04:11 AM, Arnd Bergmann wrote: > This is wrong since ioread* is not the same read* on x86 and other > architectures that have native PCI PIO accessors, or that require > additional barriers for those. > > You have to copy hi_lo_readq() here, and call ioread32 twice instead > of calling readl() twice. Same for iowrite64. > >> +#ifndef ioread64be >> +#define ioread64be(p) be64_to_cpu(ioread64(p)) >> +#endif > > This has another problem: ioread64() is defined to access little-endian > registers, just like readq(). This means that instead of be64_to_cpu() > you need swab64() and always perform the byte swap, otherwise this > would be broken on big-endian architectures. Ah, ok, understood. I'll see if I can fix both these issues. Thanks, Logan