lkml.org 
[lkml]   [2010]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 6175ddf06b6172046a329e3abfd9c901a43efd2e breaks matroxfb console
On 08/02/2010 02:35 PM, Ondrej Zary wrote:
>
> The patch below fixes it for me. Is it correct on all architectures?
>
> --- 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-02 23:31:34.000000000 +0200
> @@ -157,7 +157,7 @@ static inline void mga_memcpy_toio(vaddr
> * (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);
> #else
> u_int32_t __iomem* addr = va.vaddr;
>

I don't think so; in particular I don't *think* non-x86 architectures
will deal with the requirement that it handles an unaligned source. As
such, the #if would still be necessary; the #else clause could be
replaced with a get_unaligned() ... iowrite32() loop.

The other thing to watch out for is that "len" passed to iowrite32_rep()
is a count of 32-bit words, whereas memcpy_toio() takes a byte count...
you need to >> 2 there.

-hpa



\
 
 \ /
  Last update: 2010-08-02 23:45    [W:0.047 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site