Commit 8cc048e3 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Jeff Garzik

[PATCH] sky2: handle tx timeout

Put more logic in to try and handle transmit timeout recovery.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 69634ee7
...@@ -661,7 +661,7 @@ static void sky2_qset(struct sky2_hw *hw, u16 q) ...@@ -661,7 +661,7 @@ static void sky2_qset(struct sky2_hw *hw, u16 q)
/* Setup prefetch unit registers. This is the interface between /* Setup prefetch unit registers. This is the interface between
* hardware and driver list elements * hardware and driver list elements
*/ */
static inline void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr, static void sky2_prefetch_init(struct sky2_hw *hw, u32 qaddr,
u64 addr, u32 last) u64 addr, u32 last)
{ {
sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); sky2_write32(hw, Y2_QADDR(qaddr, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
...@@ -1558,14 +1558,25 @@ static void sky2_phy_task(void *arg) ...@@ -1558,14 +1558,25 @@ static void sky2_phy_task(void *arg)
static void sky2_tx_timeout(struct net_device *dev) static void sky2_tx_timeout(struct net_device *dev)
{ {
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;
unsigned txq = txqaddr[sky2->port];
if (netif_msg_timer(sky2)) if (netif_msg_timer(sky2))
printk(KERN_ERR PFX "%s: tx timeout\n", dev->name); printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
sky2_write32(sky2->hw, Q_ADDR(txqaddr[sky2->port], Q_CSR), BMU_STOP); netif_stop_queue(dev);
sky2_read32(sky2->hw, Q_ADDR(txqaddr[sky2->port], Q_CSR));
sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP);
sky2_read32(hw, Q_ADDR(txq, Q_CSR));
sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
sky2_tx_clean(sky2); sky2_tx_clean(sky2);
sky2_qset(hw, txq);
sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1);
netif_wake_queue(dev);
} }
......
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