[RADEON]: Fix unaligned I/O port access during probe.
authorDavid S. Miller <davem@sunset.davemloft.net>
Fri, 30 Sep 2005 02:26:51 +0000 (19:26 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Fri, 30 Sep 2005 02:26:51 +0000 (19:26 -0700)
The driver does a readl() on DEVICE_ID which is 2-byte aligned and
2-bytes in size.  It's doing this read just to flush write buffers.

Create IN16() and OUT16() macros, and use the former to do this I/O
load.

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/video/aty/radeon_base.c
drivers/video/aty/radeonfb.h

index 046b47860266daa0ec4c45124d124e90c77a941a..8a24a66d9ba8f6e7033ce0a4667c613ba8e7a183 100644 (file)
@@ -475,7 +475,7 @@ static int __devinit radeon_probe_pll_params(struct radeonfb_info *rinfo)
         */
 
        /* Flush PCI buffers ? */
-       tmp = INREG(DEVICE_ID);
+       tmp = INREG16(DEVICE_ID);
 
        local_irq_disable();
 
index 659bc9f62244aa316190dddcfa8a0aa22c78ea71..01b8b2f785140677d249fb2d72e12cf6a4396472 100644 (file)
@@ -395,6 +395,8 @@ static inline void _radeon_msleep(struct radeonfb_info *rinfo, unsigned long ms)
 
 #define INREG8(addr)           readb((rinfo->mmio_base)+addr)
 #define OUTREG8(addr,val)      writeb(val, (rinfo->mmio_base)+addr)
+#define INREG16(addr)          readw((rinfo->mmio_base)+addr)
+#define OUTREG16(addr,val)     writew(val, (rinfo->mmio_base)+addr)
 #define INREG(addr)            readl((rinfo->mmio_base)+addr)
 #define OUTREG(addr,val)       writel(val, (rinfo->mmio_base)+addr)