Skip to content

Commit c81476d

Browse files
Ondrej Zarytorvalds
authored andcommitted
matroxfb: fix incorrect use of memcpy_toio()
Screen is completely corrupted since 2.6.34. Bisection revealed that it's caused by commit 6175ddf ("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 <linux@rainbow-software.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Petr Vandrovec <vandrove@vc.cvut.cz> Cc: Jean Delvare <khali@linux-fr.org> Cc: <stable@kernel.org> [2.6.34.x, 2.6.35.x] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent b3ea36b commit c81476d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/video/matrox/matroxfb_base.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ static inline void mga_writel(vaddr_t va, unsigned int offs, u_int32_t value) {
151151
static inline void mga_memcpy_toio(vaddr_t va, const void* src, int len) {
152152
#if defined(__alpha__) || defined(__i386__) || defined(__x86_64__)
153153
/*
154-
* memcpy_toio works for us if:
154+
* iowrite32_rep works for us if:
155155
* (1) Copies data as 32bit quantities, not byte after byte,
156156
* (2) Performs LE ordered stores, and
157157
* (3) It copes with unaligned source (destination is guaranteed to be page
158158
* aligned and length is guaranteed to be multiple of 4).
159159
*/
160-
memcpy_toio(va.vaddr, src, len);
160+
iowrite32_rep(va.vaddr, src, len >> 2);
161161
#else
162162
u_int32_t __iomem* addr = va.vaddr;
163163

0 commit comments

Comments
 (0)