From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timur Tabi Subject: Re: [PATCH 4/4] ASoC: fsl: make fsl_ssi driver compilable on ARM/IMX Date: Fri, 24 Feb 2012 15:29:04 -0600 Message-ID: <4F480120.6080409@freescale.com> References: <1329979644-31046-1-git-send-email-shawn.guo@linaro.org> <1330008519-3584-1-git-send-email-shawn.guo@linaro.org> <1330008519-3584-5-git-send-email-shawn.guo@linaro.org> <4F465A33.3020208@ru.mvista.com> <4F465EE5.4010908@freescale.com> <20120223165242.GB22562@n2100.arm.linux.org.uk> <4F4671BB.7060409@freescale.com> <20120223171407.GC22562@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from VA3EHSOBE008.bigfish.com (va3ehsobe003.messaging.microsoft.com [216.32.180.13]) by alsa0.perex.cz (Postfix) with ESMTP id 8B6AE103C55 for ; Fri, 24 Feb 2012 22:29:24 +0100 (CET) In-Reply-To: <20120223171407.GC22562@n2100.arm.linux.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Russell King - ARM Linux Cc: alsa-devel@alsa-project.org, Sergei Shtylyov , Sascha Hauer , Mark Brown , Shawn Guo , linux-arm-kernel@lists.infradead.org List-Id: alsa-devel@alsa-project.org Russell King - ARM Linux wrote: >> > I'll have to ask around, because I'm sure I'm missing something. > If what you say is true, it means we have different semantics for the > same accessors on different architectures. No wonder it's needing > drivers to gain ifdefs to select appropriate accessors. > > This needs sorting out properly. It needs the semantics of readl() etc > to be fully defined, and all architectures to implement those semantics > rather than what they think would be appropriate for them. So I asked around, and sure enough, my macro-fu was weak. On PowerPC, readl() maps to in_le32(). Even though PowerPC is big-endian, some devices are little endian (e.g. PCI and some PICs). in_le32() is the byte-swapping version of in_be32(). Both functions have instruction order synchronization instructions in them. So replacing in_be32() with readl() will break on PowerPC. -- Timur Tabi Linux kernel developer at Freescale