matroxfb: fix incorrect use of memcpy_toio()
authorOndrej Zary <[email protected]>
Thu, 19 Aug 2010 21:13:25 +0000 (14:13 -0700)
committerLinus Torvalds <[email protected]>
Fri, 20 Aug 2010 16:34:54 +0000 (09:34 -0700)
Screen is completely corrupted since 2.6.34.  Bisection revealed that it's
caused by commit 6175ddf06b61720 ("x86: Clean up mem*io functions.").

H.  Peter Anvin explained that memcpy_toio() does not copy data in 32bit
chunks anymore on x86.

Signed-off-by: Ondrej Zary <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Petr Vandrovec <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: <[email protected]> [2.6.34.x, 2.6.35.x]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/video/matrox/matroxfb_base.h

index f3a4e15672d929dfbedc0ff3bbed375a9bc27b57..f96a471cb1a86d018e6ce435063ecf89b2159383 100644 (file)
@@ -151,13 +151,13 @@ static inline void mga_writel(vaddr_t va, unsigned int offs, u_int32_t value) {
 static inline void mga_memcpy_toio(vaddr_t va, const void* src, int len) {
 #if defined(__alpha__) || defined(__i386__) || defined(__x86_64__)
        /*
-        * memcpy_toio works for us if:
+        * iowrite32_rep works for us if:
         *  (1) Copies data as 32bit quantities, not byte after byte,
         *  (2) Performs LE ordered stores, and
         *  (3) It copes with unaligned source (destination is guaranteed to be page
         *      aligned and length is guaranteed to be multiple of 4).
         */
-       memcpy_toio(va.vaddr, src, len);
+       iowrite32_rep(va.vaddr, src, len >> 2);
 #else
         u_int32_t __iomem* addr = va.vaddr;