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


Groups > linux.kernel > #1268917

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

From Jisheng Zhang <jszhang@marvell.com>
Newsgroups linux.kernel
Subject [PATCH v2] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed
Date 2015-11-13 13:40 +0100
Message-ID <qulO3-6pf-27@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The driver is 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 and reduce the latency a bit on some
architectures.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
since v1:
 - correct the wrong sentence in commit msg about writel performance on
   CA9 with outer L2 cache. Thank Arnd for pointing out this in another
   thread
 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 | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed Jisheng Zhang <jszhang@marvell.com> - 2015-11-13 13:40 +0100
  Re: [PATCH v2] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed Arnd Bergmann <arnd@arndb.de> - 2015-11-13 13:50 +0100
    Re: [PATCH v2] clocksource/drivers/dw_apb_timer: Use  {readl|writel}_relaxed Jisheng Zhang <jszhang@marvell.com> - 2015-11-13 14:10 +0100
      Re: [PATCH v2] clocksource/drivers/dw_apb_timer: Use {readl|writel}_relaxed Arnd Bergmann <arnd@arndb.de> - 2015-11-13 15:00 +0100

csiph-web