tree 4835f69f454be1677094a95da85c65a7cdaef1fb
parent 9ede109bbe93d5bbe4271e346106847fbfea95a1
author Francois Romieu <[EMAIL PROTECTED]> Sat, 30 Jul 2005 13:15:01 +0200
committer Jeff Garzik <[EMAIL PROTECTED]> Sun, 31 Jul 2005 02:21:00 -0400

[PATCH] sis190: dummy read is required by the status register

Add a dummy read before accessing the status register

SiS driver suggests it.

Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>

 drivers/net/sis190.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -383,6 +383,12 @@ static int __mdio_read(struct net_device
        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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to