summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-12-06 23:01:49 (GMT)
committerJeff Garzik <jgarzik@pobox.com>2005-12-13 04:33:03 (GMT)
commitee1c81917a0c10f44c1b400482b8372e68238ff8 (patch)
tree987cfbd2134b82bea55c55fa17bd70d29df70458
parent0e670506668a43e1355b8f10c33d081a676bd521 (diff)
downloadlinux-fsl-qoriq-ee1c81917a0c10f44c1b400482b8372e68238ff8.tar.xz
[PATCH] skge: get rid of warning on race
Get rid of warning in case of race with ring full and lockless tx on the skge driver. It is possible to be in the transmit routine with no available slots and already stopped. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/net/skge.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 7164678..8b6e2a1 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2280,11 +2280,13 @@ static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev)
}
if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) {
- netif_stop_queue(dev);
- spin_unlock_irqrestore(&skge->tx_lock, flags);
+ if (!netif_stopped(dev)) {
+ netif_stop_queue(dev);
- printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
- dev->name);
+ printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",
+ dev->name);
+ }
+ spin_unlock_irqrestore(&skge->tx_lock, flags);
return NETDEV_TX_BUSY;
}