linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] matroxfb: fix incorrect use of memcpy_toio()
@ 2010-08-11 20:27 Ondrej Zary
  2010-08-11 20:41 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ondrej Zary @ 2010-08-11 20:27 UTC (permalink / raw)
  To: Petr Vandrovec
  Cc: Andrew Morton, Jean Delvare, linux-fbdev, Kernel development list

Fix incorrect use of memcpy_toio() in matroxfb that broke in 2.6.34 on x86.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>

--- linux-2.6.35-rc2/drivers/video/matrox/matroxfb_base.h	2010-06-06 05:43:24.000000000 +0200
+++ linux-2.6.35-rc3/drivers/video/matrox/matroxfb_base.h	2010-08-03 18:13:46.000000000 +0200
@@ -151,13 +151,13 @@ static inline void mga_writel(vaddr_t va
 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;
 


-- 
Ondrej Zary

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] matroxfb: fix incorrect use of memcpy_toio()
  2010-08-11 20:27 [PATCH] matroxfb: fix incorrect use of memcpy_toio() Ondrej Zary
@ 2010-08-11 20:41 ` Andrew Morton
  2010-08-11 21:16   ` Ondrej Zary
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2010-08-11 20:41 UTC (permalink / raw)
  To: Ondrej Zary
  Cc: Petr Vandrovec, Jean Delvare, linux-fbdev,
	Kernel development list

On Wed, 11 Aug 2010 22:27:42 +0200
Ondrej Zary <linux@rainbow-software.org> wrote:

> Fix incorrect use of memcpy_toio() in matroxfb that broke in 2.6.34 on x86.
> 

Thanks.

What was incorrect about it?  And what is the user-visible effect of
this regression?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] matroxfb: fix incorrect use of memcpy_toio()
  2010-08-11 20:41 ` Andrew Morton
@ 2010-08-11 21:16   ` Ondrej Zary
  0 siblings, 0 replies; 3+ messages in thread
From: Ondrej Zary @ 2010-08-11 21:16 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Petr Vandrovec, Jean Delvare, linux-fbdev,
	Kernel development list

On Wednesday 11 August 2010 22:41:36 Andrew Morton wrote:
> On Wed, 11 Aug 2010 22:27:42 +0200
>
> Ondrej Zary <linux@rainbow-software.org> wrote:
> > Fix incorrect use of memcpy_toio() in matroxfb that broke in 2.6.34 on
> > x86.
>
> Thanks.
>
> What was incorrect about it?  And what is the user-visible effect of
> this regression?

Screen is completely corrupted since 2.6.34. Bisection revealed that it's 
caused by commit 6175ddf06b6172046a329e3abfd9c901a43efd2e. H. Peter Anvin 
explained that memcpy_toio() does not copy data in 32bit chunks anymore on 
x86.

See: http://lkml.org/lkml/2010/8/2/409

-- 
Ondrej Zary

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-11 21:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11 20:27 [PATCH] matroxfb: fix incorrect use of memcpy_toio() Ondrej Zary
2010-08-11 20:41 ` Andrew Morton
2010-08-11 21:16   ` Ondrej Zary

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).