From patchwork Mon Dec 23 18:10:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taras Kondratiuk X-Patchwork-Id: 22738 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C5CE20555 for ; Mon, 23 Dec 2013 18:10:54 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id f12sf6270027vbg.8 for ; Mon, 23 Dec 2013 10:10:53 -0800 (PST) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=whsx39wrYRmlIqYQJ8xUMjHGG0m18ETHXkhaiQpaOTQ=; b=cvYm1pdI5yDI5PKdI3RKSj2KRbWzFBkqb7cDNJGWulFjtCmR94FrRVGGoIbiE0Ve8C PKo8mKTbobipS9F+fZwngCZfACelQPVHTXwUGuUKRqjWDdhFOsqmNuwyTGvbRAAEQa5e KCux18rWQKNl6Z3ZgQJwHijtr0eGpFwkY/InPLqg0X3dNLsgXb1v6WHmHJniPVt5WdIH EfJDOQtEnw/QoI7V2pq+oXfoLgqz/788ffcPppHAX28H3Jbodk9IfMe3J722nIne/7EG 54crdKcwR1E7rDgk5isLNGjgpPh4UMkwfR9y55Dcw7NVq+44IyhrR7LIdUy1mkKyMF2z ayuQ== X-Gm-Message-State: ALoCoQnpBif89YT/onXJTGhCMZ4YWyYoWuJbbOjPqupsSrqaFcqBgSwfxZGRCHXDMtGX96nNDIl1 X-Received: by 10.58.112.195 with SMTP id is3mr11272688veb.29.1387822253596; Mon, 23 Dec 2013 10:10:53 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.133 with SMTP id a5ls1659433qey.21.gmail; Mon, 23 Dec 2013 10:10:53 -0800 (PST) X-Received: by 10.52.244.73 with SMTP id xe9mr275918vdc.78.1387822253472; Mon, 23 Dec 2013 10:10:53 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id a6si5087663vdp.78.2013.12.23.10.10.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 10:10:53 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id lh4so2972313vcb.37 for ; Mon, 23 Dec 2013 10:10:53 -0800 (PST) X-Received: by 10.52.230.102 with SMTP id sx6mr11921387vdc.15.1387822253396; Mon, 23 Dec 2013 10:10:53 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp245149ved; Mon, 23 Dec 2013 10:10:52 -0800 (PST) X-Received: by 10.14.99.129 with SMTP id x1mr1493341eef.89.1387822252417; Mon, 23 Dec 2013 10:10:52 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by mx.google.com with ESMTPS id a9si21280238eew.54.2013.12.23.10.10.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 10:10:52 -0800 (PST) Received-SPF: neutral (google.com: 74.125.83.53 is neither permitted nor denied by best guess record for domain of taras.kondratiuk@linaro.org) client-ip=74.125.83.53; Received: by mail-ee0-f53.google.com with SMTP id b57so2509109eek.12 for ; Mon, 23 Dec 2013 10:10:52 -0800 (PST) X-Received: by 10.15.43.10 with SMTP id w10mr23385281eev.13.1387822251956; Mon, 23 Dec 2013 10:10:51 -0800 (PST) Received: from condor-x220.synapse.com ([195.238.93.36]) by mx.google.com with ESMTPSA id o47sm47754698eem.21.2013.12.23.10.10.50 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Dec 2013 10:10:51 -0800 (PST) From: Taras Kondratiuk To: Tony Lindgren Cc: patches@linaro.org, linaro-networking@linaro.org, linaro-kernel@lists.linaro.org, Victor Kamensky , Taras Kondratiuk , Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] ARM: OMAP: counter-32k: raw read and write endian fix Date: Mon, 23 Dec 2013 20:10:33 +0200 Message-Id: <1387822234-11167-4-git-send-email-taras.kondratiuk@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387822234-11167-1-git-send-email-taras.kondratiuk@linaro.org> References: <1387822234-11167-1-git-send-email-taras.kondratiuk@linaro.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.178 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 d9bc98e..21ca329 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 u32 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