aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTommy Christensen <tommy.christensen@tpack.net>2005-11-07 03:58:04 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:53:25 -0500
commitd9e46de34e4212f472684b1561ba323aac54ea25 (patch)
treebf8392ea5f243cc5ddbd32c82dec144ba82d036b
parent106427e65d2b6f3a519ab5d14a3586007e7e0f20 (diff)
[PATCH] 3c59x: avoid blindly reading link status twice
In order to spare some I/O operations, be more intelligent about when to read from the PHY. Pointed out by Bogdan Costescu. Signed-off-by: Tommy S. Christensen <tommy.christensen@tpack.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/net/3c59x.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 88ce4c43fd4f..e1f773d07edb 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1893,7 +1893,10 @@ vortex_timer(unsigned long data)
1893 { 1893 {
1894 spin_lock_bh(&vp->lock); 1894 spin_lock_bh(&vp->lock);
1895 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR); 1895 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
1896 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR); 1896 if (!(mii_status & BMSR_LSTATUS)) {
1897 /* Re-read to get actual link status */
1898 mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
1899 }
1897 ok = 1; 1900 ok = 1;
1898 if (vortex_debug > 2) 1901 if (vortex_debug > 2)
1899 printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n", 1902 printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",