提交 d9e46de3 编写于 作者: T Tommy Christensen 提交者: Linus Torvalds

[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: NTommy S. Christensen <tommy.christensen@tpack.net>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 106427e6
...@@ -1893,7 +1893,10 @@ vortex_timer(unsigned long data) ...@@ -1893,7 +1893,10 @@ vortex_timer(unsigned long data)
{ {
spin_lock_bh(&vp->lock); spin_lock_bh(&vp->lock);
mii_status = mdio_read(dev, vp->phys[0], MII_BMSR); mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
if (!(mii_status & BMSR_LSTATUS)) {
/* Re-read to get actual link status */
mii_status = mdio_read(dev, vp->phys[0], MII_BMSR); mii_status = mdio_read(dev, vp->phys[0], MII_BMSR);
}
ok = 1; ok = 1;
if (vortex_debug > 2) if (vortex_debug > 2)
printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n", printk(KERN_DEBUG "%s: MII transceiver has status %4.4x.\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册