Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268671

[PATCH] clocksource/drivers/dw_apb_timer: use {readl|writel}_relaxed

Path csiph.com!news.mixmin.net!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod
From Jisheng Zhang <jszhang@marvell.com>
Newsgroups linux.kernel
Subject [PATCH] clocksource/drivers/dw_apb_timer: use {readl|writel}_relaxed
Date Fri, 13 Nov 2015 09:00:02 +0100
Message-ID <quhr4-3yo-7@gated-at.bofh.it> (permalink)
X-Original-To <daniel.lezcano@linaro.org>, <tglx@linutronix.de>
X-Mailer git-send-email 2.6.2
MIME-Version 1.0
Content-Type text/plain
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2015-11-13_08:,, signatures=0
X-Proofpoint-Spam-Details rule=inbound_notspam policy=inbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1511130144
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
X-Original-Cc <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, Jisheng Zhang <jszhang@marvell.com>
X-Original-Date Fri, 13 Nov 2015 15:46:47 +0800
X-Original-Message-ID <1447400807-4706-1-git-send-email-jszhang@marvell.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1268671

Show key headers only | View raw


readl/writel is too expensive on Cortex A9 w/ outer L2 cache,
especially the writel will try to hold l2x0_lock, which could increase
chance of L2 cache maintance spinning at the l2x0_lock.

The driver does not perform DMA, so it's safe to use the relaxed
version. From another side, the relaxed io accessor macros are
available on all architectures now, so we can use the relaxed versions
to get a trivial overall system performance improvement on some
architectures.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/clocksource/dw_apb_timer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index c76c750..04282ee 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -51,13 +51,13 @@ clocksource_to_dw_apb_clocksource(struct clocksource *cs)
 
 static unsigned long apbt_readl(struct dw_apb_timer *timer, unsigned long offs)
 {
-	return readl(timer->base + offs);
+	return readl_relaxed(timer->base + offs);
 }
 
 static void apbt_writel(struct dw_apb_timer *timer, unsigned long val,
 		 unsigned long offs)
 {
-	writel(val, timer->base + offs);
+	writel_relaxed(val, timer->base + offs);
 }
 
 static void apbt_disable_int(struct dw_apb_timer *timer)
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] clocksource/drivers/dw_apb_timer: use {readl|writel}_relaxed Jisheng Zhang <jszhang@marvell.com> - 2015-11-13 09:00 +0100

csiph-web