]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] sis190: dummy read is required by the status register
authorFrancois Romieu <romieu@fr.zoreil.com>
Sat, 30 Jul 2005 11:15:01 +0000 (13:15 +0200)
committerJeff Garzik <jgarzik@pobox.com>
Sat, 30 Jul 2005 22:21:00 +0000 (18:21 -0400)
Add a dummy read before accessing the status register

SiS driver suggests it.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/sis190.c

index f78799c4235e9b789891095037889d0ab70709e7..392110ede7b7375b5880736ac164e20ffc9ab8f7 100644 (file)
@@ -383,6 +383,12 @@ static int __mdio_read(struct net_device *dev, int phy_id, int reg)
        return mdio_read(tp->mmio_addr, phy_id, reg);
 }
 
+static u16 mdio_read_latched(void __iomem *ioaddr, int phy_id, int reg)
+{
+       mdio_read(ioaddr, phy_id, reg);
+       return mdio_read(ioaddr, phy_id, reg);
+}
+
 static u16 __devinit sis190_read_eeprom(void __iomem *ioaddr, u32 reg)
 {
        u16 data = 0xffff;
@@ -881,7 +887,8 @@ static void sis190_phy_task(void * data)
        if (val & BMCR_RESET) {
                // FIXME: needlessly high ?  -- FR 02/07/2005
                mod_timer(&tp->timer, jiffies + HZ/10);
-       } else if (!(mdio_read(ioaddr, phy_id, MII_BMSR) & BMSR_ANEGCOMPLETE)) {
+       } else if (!(mdio_read_latched(ioaddr, phy_id, MII_BMSR) &
+                    BMSR_ANEGCOMPLETE)) {
                net_link(tp, KERN_WARNING "%s: PHY reset until link up.\n",
                         dev->name);
                mdio_write(ioaddr, phy_id, MII_BMCR, val | BMCR_RESET);