aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 9f2661355a4a..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/**
@@ -552,9 +558,9 @@ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id,
552#else 558#else
553 if (eth_int_cause & ETH_INT_CAUSE_RX) 559 if (eth_int_cause & ETH_INT_CAUSE_RX)
554 mv643xx_eth_receive_queue(dev, INT_MAX); 560 mv643xx_eth_receive_queue(dev, INT_MAX);
561#endif
555 if (eth_int_cause_ext & ETH_INT_CAUSE_TX) 562 if (eth_int_cause_ext & ETH_INT_CAUSE_TX)
556 mv643xx_eth_free_completed_tx_descs(dev); 563 mv643xx_eth_free_completed_tx_descs(dev);
557#endif
558 564
559 /* 565 /*
560 * If no real interrupt occured, exit. 566 * If no real interrupt occured, exit.
@@ -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)) {