linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guido Guenther <agx@sigxcpu.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: adaplas@pol.net,
	Linux Fbdev development list
	<linux-fbdev-devel@lists.sourceforge.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: Re: [PATCH] fbdev: Fix IO access in rivafb
Date: Fri, 12 Nov 2004 20:18:52 +0100	[thread overview]
Message-ID: <20041112191852.GA4536@bogon.ms20.nix> (raw)
In-Reply-To: <Pine.LNX.4.58.0411120755570.2301@ppc970.osdl.org>

On Fri, Nov 12, 2004 at 08:01:00AM -0800, Linus Torvalds wrote:
> On Fri, 12 Nov 2004, Guido Guenther wrote:
> >
> > Doesn't work for me. This one works:
> > 
> > diff -u -u linux-2.6.10-rc1-mm5.orig/drivers/video/riva/riva_hw.h linux-2.6.10-rc1-mm5/drivers/video/riva/riva_hw.h
> > --- linux-2.6.10-rc1-mm5.orig/drivers/video/riva/riva_hw.h	2004-11-12 13:42:54.000000000 +0100
> > +++ linux-2.6.10-rc1-mm5/drivers/video/riva/riva_hw.h	2004-11-12 13:47:29.400807920 +0100
> > @@ -75,12 +75,12 @@
> >   */
> >  #include <asm/io.h>
> >  
> > -#define NV_WR08(p,i,d)  (__raw_writeb((d), (void __iomem *)(p) + (i)))
> > -#define NV_RD08(p,i)    (__raw_readb((void __iomem *)(p) + (i)))
> > -#define NV_WR16(p,i,d)  (__raw_writew((d), (void __iomem *)(p) + (i)))
> > -#define NV_RD16(p,i)    (__raw_readw((void __iomem *)(p) + (i)))
> > -#define NV_WR32(p,i,d)  (__raw_writel((d), (void __iomem *)(p) + (i)))
> > -#define NV_RD32(p,i)    (__raw_readl((void __iomem *)(p) + (i)))
> > +#define NV_WR08(p,i,d)  (writeb((d), (u8 __iomem *)(p) + (i)))
> > +#define NV_RD08(p,i)    (readb((u8 __iomem *)(p) + (i)))
> > +#define NV_WR16(p,i,d)  (__raw_writew((d), (u16 __iomem *)(p) + (i)/2))
> > +#define NV_RD16(p,i)    (__raw_readw((u16 __iomem *)(p) + (i)/2))
> > +#define NV_WR32(p,i,d)  (__raw_writel((d), (u32 __iomem *)(p) + (i)/4))
> > +#define NV_RD32(p,i)    (__raw_readl((u32 __iomem *)(p) + (i)/4))
> 
> Can you please try without the broken "u16" and "(i/2)" things (and u32
> and i/4)? They really should not be needed, unless something is
> _seriously_ broken. The only thing they do is the automatically align the
> reference - and quite frankly, it looks like anybody passing an unaligned
> register offset is _quite_ buggy.
O.k., it was the __raw_{write,read}b which broke things, not the
"alignment". This one works:

diff -u -u linux-2.6.10-rc1-mm5.orig/drivers/video/riva/riva_hw.h linux-2.6.10-rc1-mm5/drivers/video/riva/riva_hw.h
--- linux-2.6.10-rc1-mm5.orig/drivers/video/riva/riva_hw.h	2004-11-12 13:42:54.000000000 +0100
+++ linux-2.6.10-rc1-mm5/drivers/video/riva/riva_hw.h	2004-11-12 17:39:22.000000000 +0100
@@ -75,8 +75,8 @@
  */
 #include <asm/io.h>
 
-#define NV_WR08(p,i,d)  (__raw_writeb((d), (void __iomem *)(p) + (i)))
-#define NV_RD08(p,i)    (__raw_readb((void __iomem *)(p) + (i)))
+#define NV_WR08(p,i,d)  (writeb((d), (void __iomem *)(p) + (i)))
+#define NV_RD08(p,i)    (readb((void __iomem *)(p) + (i)))
 #define NV_WR16(p,i,d)  (__raw_writew((d), (void __iomem *)(p) + (i)))
 #define NV_RD16(p,i)    (__raw_readw((void __iomem *)(p) + (i)))
 #define NV_WR32(p,i,d)  (__raw_writel((d), (void __iomem *)(p) + (i)))

Signed-off-by: Guido Guenther <agx@sigxcpu.org>

> IOW, it would seem that the real difference is the "__raw_writeb" vs
> "writeb". Can you test just that change?
> 
> >  #define VGA_WR08(p,i,d) NV_WR08(p,i,d)
> >  #define VGA_RD08(p,i)   NV_RD08(p,i)
> > 
> > Interesting enough this one doesn't (only differenc in NV_{WR,RW}08:
> > 
> 
> I don't see the difference to your other patch. Did you put in the wrong
> patch?
There aren't any, I actually attached the wrong patch. The non-working
version has __raw_{read,write}b8 instead of {read,write}b8. In 2.6.9
riva_hw.h used {in,out}_8 for NV_{RD,WR}08 so using the "non-raw"
writeb/readb now looks correct since these map to {in,out}_8 now.
Cheers,
 -- Guido


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click

  reply	other threads:[~2004-11-12 19:21 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 ` [PATCH] fbdev: Fix IO access in rivafb Benjamin Herrenschmidt
2004-11-08  8:33   ` [Linux-fbdev-devel] " 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 [this message]
2004-11-12 19:32                     ` 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=20041112191852.GA4536@bogon.ms20.nix \
    --to=agx@sigxcpu.org \
    --cc=adaplas@pol.net \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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).