diff options
-rw-r--r-- | drivers/net/mv643xx_eth.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 85ac42c85aa9..ea62a3e7d586 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -281,10 +281,16 @@ static void mv643xx_eth_tx_timeout_task(struct net_device *dev) | |||
281 | { | 281 | { |
282 | struct mv643xx_private *mp = netdev_priv(dev); | 282 | struct mv643xx_private *mp = netdev_priv(dev); |
283 | 283 | ||
284 | netif_device_detach(dev); | 284 | if (!netif_running(dev)) |
285 | return; | ||
286 | |||
287 | netif_stop_queue(dev); | ||
288 | |||
285 | eth_port_reset(mp->port_num); | 289 | eth_port_reset(mp->port_num); |
286 | eth_port_start(dev); | 290 | eth_port_start(dev); |
287 | netif_device_attach(dev); | 291 | |
292 | if (mp->tx_ring_size - mp->tx_desc_count >= MAX_DESCS_PER_SKB) | ||
293 | netif_wake_queue(dev); | ||
288 | } | 294 | } |
289 | 295 | ||
290 | /** | 296 | /** |
@@ -1186,7 +1192,12 @@ static int mv643xx_eth_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1186 | 1192 | ||
1187 | BUG_ON(netif_queue_stopped(dev)); | 1193 | BUG_ON(netif_queue_stopped(dev)); |
1188 | BUG_ON(skb == NULL); | 1194 | BUG_ON(skb == NULL); |
1189 | BUG_ON(mp->tx_ring_size - mp->tx_desc_count < MAX_DESCS_PER_SKB); | 1195 | |
1196 | if (mp->tx_ring_size - mp->tx_desc_count < MAX_DESCS_PER_SKB) { | ||
1197 | printk(KERN_ERR "%s: transmit with queue full\n", dev->name); | ||
1198 | netif_stop_queue(dev); | ||
1199 | return 1; | ||
1200 | } | ||
1190 | 1201 | ||
1191 | if (has_tiny_unaligned_frags(skb)) { | 1202 | if (has_tiny_unaligned_frags(skb)) { |
1192 | if ((skb_linearize(skb, GFP_ATOMIC) != 0)) { | 1203 | if ((skb_linearize(skb, GFP_ATOMIC) != 0)) { |