Commit b1aefe58 authored by Alex Bounine's avatar Alex Bounine Committed by Jeff Garzik

Tsi108_eth: fix link recovery after disconnect

Bug fix for tsi108_eth network driver.
This patch fixes a problem with link recovery after connection was lost.
Signed-off-by: default avatarAlexandre Bounine <alexandreb@tundra.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 85bbe215
...@@ -338,6 +338,7 @@ static void tsi108_check_phy(struct net_device *dev) ...@@ -338,6 +338,7 @@ static void tsi108_check_phy(struct net_device *dev)
TSI_WRITE(TSI108_MAC_CFG2, mac_cfg2_reg); TSI_WRITE(TSI108_MAC_CFG2, mac_cfg2_reg);
TSI_WRITE(TSI108_EC_PORTCTRL, portctrl_reg); TSI_WRITE(TSI108_EC_PORTCTRL, portctrl_reg);
}
if (data->link_up == 0) { if (data->link_up == 0) {
/* The manual says it can take 3-4 usecs for the speed change /* The manual says it can take 3-4 usecs for the speed change
...@@ -352,8 +353,6 @@ static void tsi108_check_phy(struct net_device *dev) ...@@ -352,8 +353,6 @@ static void tsi108_check_phy(struct net_device *dev)
data->link_up = 1; data->link_up = 1;
spin_unlock(&data->txlock); spin_unlock(&data->txlock);
} }
}
} else { } else {
if (data->link_up == 1) { if (data->link_up == 1) {
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1267,12 +1266,11 @@ static void tsi108_init_phy(struct net_device *dev) ...@@ -1267,12 +1266,11 @@ static void tsi108_init_phy(struct net_device *dev)
* PHY_STAT register before the link up status bit is set. * PHY_STAT register before the link up status bit is set.
*/ */
data->link_up = 1; data->link_up = 0;
while (!((phyval = tsi108_read_mii(data, MII_BMSR)) & while (!((phyval = tsi108_read_mii(data, MII_BMSR)) &
BMSR_LSTATUS)) { BMSR_LSTATUS)) {
if (i++ > (MII_READ_DELAY / 10)) { if (i++ > (MII_READ_DELAY / 10)) {
data->link_up = 0;
break; break;
} }
spin_unlock_irqrestore(&phy_lock, flags); spin_unlock_irqrestore(&phy_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment