public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Ondrej Zary <linux@rainbow-software.org>
Cc: brgerst@gmail.com,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: 6175ddf06b6172046a329e3abfd9c901a43efd2e breaks matroxfb console
Date: Mon, 02 Aug 2010 14:42:29 -0700	[thread overview]
Message-ID: <4C573BC5.70007@zytor.com> (raw)
In-Reply-To: <201008022335.12191.linux@rainbow-software.org>

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


  reply	other threads:[~2010-08-02 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 19:49 6175ddf06b6172046a329e3abfd9c901a43efd2e breaks matroxfb console Ondrej Zary
2010-08-02 21:04 ` H. Peter Anvin
2010-08-02 21:14   ` Ondrej Zary
2010-08-02 21:15     ` H. Peter Anvin
2010-08-02 21:35       ` Ondrej Zary
2010-08-02 21:42         ` H. Peter Anvin [this message]
2010-08-03 18:34           ` Ondrej Zary
  -- strict thread matches above, loose matches on Subject: below --
2010-08-02 23:53 Chris Rankin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C573BC5.70007@zytor.com \
    --to=hpa@zytor.com \
    --cc=brgerst@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rainbow-software.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox