diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-25 03:39:25 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-25 03:39:25 -0400 |
commit | af06bb9f12990cae941816f9d7051dc5bf93c8a2 (patch) | |
tree | 67db11243a02d7f274159dc52350228476831a41 /arch/arm/include | |
parent | 72c04af9a2d57b7945cf3de8e71461bd80695d50 (diff) |
ARM: fix out[bwl]()
out[bwl]() had a side effect that gcc read-back from the register after
writing its value. This causes a problem for at least 3c589_cs, which
spits out lots of "adapter failure, FIFO diagnostic register 2011."
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/io.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 9af5563dd3eb..815c669fec0a 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -47,9 +47,9 @@ extern void __raw_readsb(const void __iomem *addr, void *data, int bytelen); | |||
47 | extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); | 47 | extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen); |
48 | extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); | 48 | extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); |
49 | 49 | ||
50 | #define __raw_writeb(v,a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v)) | 50 | #define __raw_writeb(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned char __force *)(a) = (v))) |
51 | #define __raw_writew(v,a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v)) | 51 | #define __raw_writew(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned short __force *)(a) = (v))) |
52 | #define __raw_writel(v,a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v)) | 52 | #define __raw_writel(v,a) ((void)(__chk_io_ptr(a), *(volatile unsigned int __force *)(a) = (v))) |
53 | 53 | ||
54 | #define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) | 54 | #define __raw_readb(a) (__chk_io_ptr(a), *(volatile unsigned char __force *)(a)) |
55 | #define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) | 55 | #define __raw_readw(a) (__chk_io_ptr(a), *(volatile unsigned short __force *)(a)) |
@@ -229,11 +229,9 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
229 | #define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \ | 229 | #define readl_relaxed(c) ({ u32 __r = le32_to_cpu((__force __le32) \ |
230 | __raw_readl(c)); __r; }) | 230 | __raw_readl(c)); __r; }) |
231 | 231 | ||
232 | #define writeb_relaxed(v,c) ((void)__raw_writeb(v,c)) | 232 | #define writeb_relaxed(v,c) __raw_writeb(v,c) |
233 | #define writew_relaxed(v,c) ((void)__raw_writew((__force u16) \ | 233 | #define writew_relaxed(v,c) __raw_writew((__force u16) cpu_to_le16(v),c) |
234 | cpu_to_le16(v),c)) | 234 | #define writel_relaxed(v,c) __raw_writel((__force u32) cpu_to_le32(v),c) |
235 | #define writel_relaxed(v,c) ((void)__raw_writel((__force u32) \ | ||
236 | cpu_to_le32(v),c)) | ||
237 | 235 | ||
238 | #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) | 236 | #define readb(c) ({ u8 __v = readb_relaxed(c); __iormb(); __v; }) |
239 | #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) | 237 | #define readw(c) ({ u16 __v = readw_relaxed(c); __iormb(); __v; }) |
@@ -281,12 +279,12 @@ extern void _memset_io(volatile void __iomem *, int, size_t); | |||
281 | #define ioread16be(p) ({ unsigned int __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; }) | 279 | #define ioread16be(p) ({ unsigned int __v = be16_to_cpu((__force __be16)__raw_readw(p)); __iormb(); __v; }) |
282 | #define ioread32be(p) ({ unsigned int __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; }) | 280 | #define ioread32be(p) ({ unsigned int __v = be32_to_cpu((__force __be32)__raw_readl(p)); __iormb(); __v; }) |
283 | 281 | ||
284 | #define iowrite8(v,p) ({ __iowmb(); (void)__raw_writeb(v, p); }) | 282 | #define iowrite8(v,p) ({ __iowmb(); __raw_writeb(v, p); }) |
285 | #define iowrite16(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_le16(v), p); }) | 283 | #define iowrite16(v,p) ({ __iowmb(); __raw_writew((__force __u16)cpu_to_le16(v), p); }) |
286 | #define iowrite32(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_le32(v), p); }) | 284 | #define iowrite32(v,p) ({ __iowmb(); __raw_writel((__force __u32)cpu_to_le32(v), p); }) |
287 | 285 | ||
288 | #define iowrite16be(v,p) ({ __iowmb(); (void)__raw_writew((__force __u16)cpu_to_be16(v), p); }) | 286 | #define iowrite16be(v,p) ({ __iowmb(); __raw_writew((__force __u16)cpu_to_be16(v), p); }) |
289 | #define iowrite32be(v,p) ({ __iowmb(); (void)__raw_writel((__force __u32)cpu_to_be32(v), p); }) | 287 | #define iowrite32be(v,p) ({ __iowmb(); __raw_writel((__force __u32)cpu_to_be32(v), p); }) |
290 | 288 | ||
291 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) | 289 | #define ioread8_rep(p,d,c) __raw_readsb(p,d,c) |
292 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) | 290 | #define ioread16_rep(p,d,c) __raw_readsw(p,d,c) |