aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-09 14:35:07 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-12-12 15:27:21 -0500
commit8cc048e338ad4034255f3ff72ef1f631963e1263 (patch)
tree95cb0c92ff78511ad5980dd53118b70657fb870d
parent69634ee7366d05b26b2650584bed180edf923125 (diff)
[PATCH] sky2: handle tx timeout
Put more logic in to try and handle transmit timeout recovery. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/sky2.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 0b82dbba16cf..e1733aa17790 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -661,7 +661,7 @@ static void sky2_qset(struct sky2_hw *hw, u16 q)
661/* Setup prefetch unit registers. This is the interface between 661/* Setup prefetch unit registers. This is the interface between
662 * hardware and driver list elements 662 * hardware and driver list elements
663 */ 663 */
664static inline void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr, 664static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr,
665 u64 addr, u32 last) 665 u64 addr, u32 last)
666{ 666{
667 sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); 667 sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
@@ -1558,14 +1558,25 @@ out:
1558static void sky2_tx_timeout(struct net_device *dev) 1558static void sky2_tx_timeout(struct net_device *dev)
1559{ 1559{
1560 struct sky2_port *sky2 = netdev_priv(dev); 1560 struct sky2_port *sky2 = netdev_priv(dev);
1561 struct sky2_hw *hw = sky2->hw;
1562 unsigned txq = txqaddr[sky2->port];
1561 1563
1562 if (netif_msg_timer(sky2)) 1564 if (netif_msg_timer(sky2))
1563 printk(KERN_ERR PFX "%s: tx timeout\n", dev->name); 1565 printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
1564 1566
1565 sky2_write32(sky2->hw, Q_ADDR(txqaddr[sky2->port], Q_CSR), BMU_STOP); 1567 netif_stop_queue(dev);
1566 sky2_read32(sky2->hw, Q_ADDR(txqaddr[sky2->port], Q_CSR)); 1568
1569 sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP);
1570 sky2_read32(hw, Q_ADDR(txq, Q_CSR));
1571
1572 sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
1567 1573
1568 sky2_tx_clean(sky2); 1574 sky2_tx_clean(sky2);
1575
1576 sky2_qset(hw, txq);
1577 sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1);
1578
1579 netif_wake_queue(dev);
1569} 1580}
1570 1581
1571 1582