]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ppc64: Fix __raw_* IO accessors
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 21 Sep 2004 00:11:36 +0000 (17:11 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 21 Sep 2004 00:11:36 +0000 (17:11 -0700)
Linus removed the "volatile" statement from the definition of the
__raw_* IO accessors on ppc64, which cause some real bad optisations to
happen in some fbdev's like matroxfb to happen (just imagine that
matroxfb loops reading an IO register waiting for a bit to change).

The __raw_xxxx() functions still want ordered accesses (they avoid the
byteswap, though)

Signed-off-by: Benjamin Herrenschmidt <benh@kenrel.crashing.org>
include/asm-ppc64/io.h

index 1e9cd557352eaa204c28dd2dc2ec21d566fb3daa..46d47573d1a44fa384255a85049d371900cd876f 100644 (file)
@@ -71,35 +71,35 @@ extern unsigned long pci_io_base;
 
 static inline unsigned char __raw_readb(const volatile void __iomem *addr)
 {
-       return *(unsigned char __force *)addr;
+       return *(volatile unsigned char __force *)addr;
 }
 static inline unsigned short __raw_readw(const volatile void __iomem *addr)
 {
-       return *(unsigned short __force *)addr;
+       return *(volatile unsigned short __force *)addr;
 }
 static inline unsigned int __raw_readl(const volatile void __iomem *addr)
 {
-       return *(unsigned int __force *)addr;
+       return *(volatile unsigned int __force *)addr;
 }
 static inline unsigned long __raw_readq(const volatile void __iomem *addr)
 {
-       return *(unsigned long __force *)addr;
+       return *(volatile unsigned long __force *)addr;
 }
 static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
 {
-       *(unsigned char __force *)addr = v;
+       *(volatile unsigned char __force *)addr = v;
 }
 static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
 {
-       *(unsigned short __force *)addr = v;
+       *(volatile unsigned short __force *)addr = v;
 }
 static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
 {
-       *(unsigned int __force *)addr = v;
+       *(volatile unsigned int __force *)addr = v;
 }
 static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
 {
-       *(unsigned long __force *)addr = v;
+       *(volatile unsigned long __force *)addr = v;
 }
 #define readb(addr)            eeh_readb(addr)
 #define readw(addr)            eeh_readw(addr)