Thread (10 messages) 10 messages, 4 authors, 2014-07-14

[PATCH v2 2/3] ARM: Use include/asm-generic/io.h

From: catalin.marinas@arm.com (Catalin Marinas)
Date: 2014-07-12 14:18:19
Also in: linux-arch, lkml

On 12 Jul 2014, at 13:27, Arnd Bergmann [off-list ref] wrote:
On Friday 11 July 2014, Catalin Marinas wrote:
quoted
On Fri, Jul 11, 2014 at 04:31:11PM +0100, Thierry Reding wrote:
quoted
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index a78562f21aab..ef54f5c8a7ae 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
[...]
quoted
-#define iowrite16be(v,p) ({ __iowmb(); __raw_writew((__force __u16)cpu_to_be16(v), p); })
-#define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force __u32)cpu_to_be32(v), p); })
Aren't you losing the barrier semantics here? The generic iowrite*be()
functions call __raw_write*() directly which don't have a barrier
(write* accessors do).
Indeed, sorry for missing this. The generic implementation still makes sense for
include/asm-generic, but arm32 and arm64 must provide their own versions here.
I think this would be the easiest. But the asm-generic/io.h needs some
#ifndef iowrite16be checks.

(in arm64 we missed the iowrite*be barriers completely, so not broken by
this patch; Thierry could update arm64 as well with patch 3/3)

Catalin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help