From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bagnes.atmel.com (smtpeu1.atmel.com [195.65.72.27]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 94D4CDDE24 for ; Tue, 3 Jun 2008 17:46:58 +1000 (EST) Date: Tue, 3 Jun 2008 09:46:46 +0200 From: Haavard Skinnemoen To: Scott Wood Subject: Re: MMIO and gcc re-ordering issue Message-ID: <20080603094646.0dbf2911@hskinnemo-gx745.norway.atmel.com> In-Reply-To: <20080602154812.GB2734@loki.buserror.net> References: <1211924335.3286.89.camel@pasglop> <20080527214241.GA22636@parisc-linux.org> <1211926636.3286.100.camel@pasglop> <20080528103648.54eb8734@hskinnemo-gx745.norway.atmel.com> <1212110003.15633.0.camel@pasglop> <20080530080700.773a82cc@siona.local> <1212132267.15633.69.camel@pasglop> <20080530102706.56fca248@siona.local> <20080602101102.0d8979c5@hskinnemo-gx745.norway.atmel.com> <20080602154812.GB2734@loki.buserror.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Cc: linux-arch@vger.kernel.org, Matthew Wilcox , linux-kernel@vger.kernel.org, tpiepho@freescale.com, linuxppc-dev@ozlabs.org, Geert Uytterhoeven , Linus Torvalds , David Miller , alan@lxorguk.ukuu.org.uk List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Scott Wood wrote: > On Mon, Jun 02, 2008 at 10:11:02AM +0200, Haavard Skinnemoen wrote: > > Geert Uytterhoeven wrote: > > > On Fri, 30 May 2008, Haavard Skinnemoen wrote: > > > > Maybe we need another interface that does not do byteswapping but > > > > provides stronger ordering guarantees? > > > > > > The byte swapping depends on the device/bus. > > > > Of course. But isn't it reasonable to assume that a device integrated > > on the same silicon as the CPU is connected to a somewhat sane bus > > which doesn't require any byte swapping? > > No, unfortunately. :-( Ok, I guess I was being naive. > See the end of drivers/dma/fsldma.h. Likewise with Freescale's PCI host > bridges; for some reason the bus itself being little endian led to the host > bridge control registers also being little endian. Right. But still, isn't it better to handle it on a case-by-case basis in the drivers? In some cases, it's best to explicitly use a certain byte order, in others it's best to use whatever is native to the CPU. Haavard