From patchwork Tue Apr 15 17:37:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 28419 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E55E82036D for ; Tue, 15 Apr 2014 17:38:15 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf21917035ykp.5 for ; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=S10PAZ8W8pBg2Yq97AUJ3jWBSrQj9uqHoCTuMv24kzk=; b=WfegqTZO3u964CqBvvzd2lqhTJmKvgP+QHTvjY72n3RXJ7+4gto8NQFAFK0XWXE3+U yR53rTqGcEYTjTZgcHGpcB/yWkUirso1YJBKjBa5n1Ks7WaEsFmJMhNP6c3xglZ+YrhY qqAAqSYKHpV9YXommfrGyR+7DGa/l8uRBeqdgzEbaM4nJzKnstJzcza9r7vuACjwdbNN tprPT1ExvFFzd0sS1ypKKKzaBsoT0Dxgu6u2GUeq6k1NfGYWBZ4SVBQqCFRSOARDXoZ7 vuXNdG21T8vwz1yQtsAw8g2P7T+ub+nqV2hG5vSOOnnnnl5UQvuXqaryQVmV6BWvtfI/ lZ+Q== X-Gm-Message-State: ALoCoQkmCcB2MrXH3Ll5Zg2GwMjwtCAj39xbhWalhgxJKk5xpkd14HP2cR4MfCEyzCLCwUck6o0q X-Received: by 10.236.138.113 with SMTP id z77mr1102361yhi.25.1397583495537; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.99 with SMTP id m90ls262599qgd.12.gmail; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) X-Received: by 10.220.98.143 with SMTP id q15mr968973vcn.38.1397583495392; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id ck5si2497766vdd.127.2014.04.15.10.38.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 10:38:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so9566857vcb.35 for ; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) X-Received: by 10.220.191.134 with SMTP id dm6mr2318522vcb.16.1397583495296; Tue, 15 Apr 2014 10:38:15 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp249641vcb; Tue, 15 Apr 2014 10:38:14 -0700 (PDT) X-Received: by 10.69.25.69 with SMTP id io5mr3503739pbd.22.1397583494600; Tue, 15 Apr 2014 10:38:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz6si6221062pac.133.2014.04.15.10.38.14; Tue, 15 Apr 2014 10:38:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754247AbaDORiL (ORCPT + 5 others); Tue, 15 Apr 2014 13:38:11 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:39018 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751905AbaDORiF (ORCPT ); Tue, 15 Apr 2014 13:38:05 -0400 Received: by mail-ee0-f42.google.com with SMTP id d17so8038217eek.1 for ; Tue, 15 Apr 2014 10:38:04 -0700 (PDT) X-Received: by 10.14.115.1 with SMTP id d1mr4369443eeh.30.1397583484394; Tue, 15 Apr 2014 10:38:04 -0700 (PDT) Received: from uglx0153363.itg.ti.com ([195.238.92.128]) by mx.google.com with ESMTPSA id n41sm50741279eeg.4.2014.04.15.10.38.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Apr 2014 10:38:03 -0700 (PDT) From: Taras Kondratiuk To: Tony Lindgren Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky , Taras Kondratiuk Subject: [RESEND PATCH 3/4] ARM: OMAP: counter-32k: raw read and write endian fix Date: Tue, 15 Apr 2014 20:37:48 +0300 Message-Id: <1397583469-14457-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397583469-14457-1-git-send-email-taras.kondratiuk@linaro.org> References: <1397583469-14457-1-git-send-email-taras.kondratiuk@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: taras.kondratiuk@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Victor Kamensky All OMAP IP blocks expect LE data, but CPU may operate in BE mode. Need to use endian neutral functions to read/write h/w registers. I.e instead of __raw_read[lw] and __raw_write[lw] functions code need to use read[lw]_relaxed and write[lw]_relaxed functions. If the first simply reads/writes register, the second will byteswap it if host operates in BE mode. Changes are trivial sed like replacement of __raw_xxx functions with xxx_relaxed variant. Signed-off-by: Victor Kamensky Signed-off-by: Taras Kondratiuk --- arch/arm/plat-omap/counter_32k.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index 384a776d..61b4d70 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c @@ -40,7 +40,7 @@ static void __iomem *sync32k_cnt_reg; static u64 notrace omap_32k_read_sched_clock(void) { - return sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0; + return sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; } /** @@ -64,7 +64,7 @@ static void omap_read_persistent_clock(struct timespec *ts) spin_lock_irqsave(&read_persistent_clock_lock, flags); last_cycles = cycles; - cycles = sync32k_cnt_reg ? __raw_readl(sync32k_cnt_reg) : 0; + cycles = sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; nsecs = clocksource_cyc2ns(cycles - last_cycles, persistent_mult, persistent_shift); @@ -95,7 +95,7 @@ int __init omap_init_clocksource_32k(void __iomem *vbase) * The 'SCHEME' bits(30-31) of the revision register is used * to identify the version. */ - if (__raw_readl(vbase + OMAP2_32KSYNCNT_REV_OFF) & + if (readl_relaxed(vbase + OMAP2_32KSYNCNT_REV_OFF) & OMAP2_32KSYNCNT_REV_SCHEME) sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF_HIGH; else