From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Linux Kernel list <linux-kernel@vger.kernel.org>
Cc: "Antonino A. Daplas" <adaplas@hotpop.com>,
Linux Fbdev development list
<linux-fbdev-devel@lists.sourceforge.net>
Subject: Re: [PATCH] fbdev: Fix IO access in rivafb
Date: Mon, 08 Nov 2004 16:57:26 +1100 [thread overview]
Message-ID: <1099893447.10262.154.camel@gaston> (raw)
In-Reply-To: <200411080521.iA85LbG6025914@hera.kernel.org>
> diff -Nru a/drivers/video/riva/riva_hw.h b/drivers/video/riva/riva_hw.h
> --- a/drivers/video/riva/riva_hw.h 2004-11-07 21:21:47 -08:00
> +++ b/drivers/video/riva/riva_hw.h 2004-11-07 21:21:47 -08:00
> @@ -78,13 +78,13 @@
> #define NV_WR08(p,i,d) out_8(p+i, d)
> #define NV_RD08(p,i) in_8(p+i)
> #else
> -#define NV_WR08(p,i,d) (((U008 *)(p))[i]=(d))
> -#define NV_RD08(p,i) (((U008 *)(p))[i])
> +#define NV_WR08(p,i,d) (writeb((d), (u8 __iomem *)(p) + (i)))
> +#define NV_RD08(p,i) (readb((u8 __iomem *)(p) + (i)))
> #endif
> -#define NV_WR16(p,i,d) (((U016 *)(p))[(i)/2]=(d))
> -#define NV_RD16(p,i) (((U016 *)(p))[(i)/2])
> -#define NV_WR32(p,i,d) (((U032 *)(p))[(i)/4]=(d))
> -#define NV_RD32(p,i) (((U032 *)(p))[(i)/4])
> +#define NV_WR16(p,i,d) (writew((d), (u16 __iomem *)(p) + (i)/2))
> +#define NV_RD16(p,i) (readw((u16 __iomem *)(p) + (i)/2))
> +#define NV_WR32(p,i,d) (writel((d), (u32 __iomem *)(p) + (i)/4))
> +#define NV_RD32(p,i) (readl((u32 __iomem *)(p) + (i)/4))
> #define VGA_WR08(p,i,d) NV_WR08(p,i,d)
> #define VGA_RD08(p,i) NV_RD08(p,i)
You probably broke ppc versions here. The driver enables "big endian"
register access, but readw/writew/l functions do byteswap, which will
lead to incorrect results.
The fix would be to probably just remove the code that puts the chip
registers into big endian mode, this isn't necessary nor a very good
idea actually.
I don't have an nVidia card on ppc to test any more unfortunately.
Ben.
next parent reply other threads:[~2004-11-08 5:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200411080521.iA85LbG6025914@hera.kernel.org>
2004-11-08 5:57 ` Benjamin Herrenschmidt [this message]
2004-11-08 8:33 ` [Linux-fbdev-devel] Re: [PATCH] fbdev: Fix IO access in rivafb Antonino A. Daplas
2004-11-08 21:50 ` Benjamin Herrenschmidt
2004-11-08 22:18 ` Antonino A. Daplas
2004-11-08 9:06 ` Antonino A. Daplas
2004-11-08 9:55 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2004-11-08 15:21 ` Linus Torvalds
2004-11-08 20:02 ` [Linux-fbdev-devel] " Antonino A. Daplas
2004-11-08 20:13 ` Linus Torvalds
2004-11-08 22:08 ` Antonino A. Daplas
2004-11-08 22:25 ` Linus Torvalds
2004-11-12 12:51 ` Guido Guenther
2004-11-12 16:01 ` [Linux-fbdev-devel] " Linus Torvalds
2004-11-12 19:18 ` Guido Guenther
2004-11-12 19:32 ` [Linux-fbdev-devel] " Linus Torvalds
2004-11-13 12:57 ` Guido Guenther
2004-11-13 1:39 ` Benjamin Herrenschmidt
2004-11-13 11:22 ` Guido Guenther
2004-11-13 12:00 ` Antonino A. Daplas
2004-11-13 13:02 ` Guido Guenther
2004-11-13 18:00 ` [Linux-fbdev-devel] " Linus Torvalds
2004-11-13 21:29 ` Antonino A. Daplas
2004-11-13 22:54 ` Guido Guenther
2004-11-13 23:52 ` Benjamin Herrenschmidt
2004-11-13 23:49 ` Benjamin Herrenschmidt
2004-11-13 12:20 ` [Linux-fbdev-devel] " Yasushi SHOJI
2004-11-08 21:52 ` Benjamin Herrenschmidt
2004-11-08 23:07 ` Giuseppe Bilotta
2004-11-13 23:22 ` Guido Guenther
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=1099893447.10262.154.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=adaplas@hotpop.com \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).