提交 be61ea52 编写于 作者: W Weiwei Wang 提交者: Jeff Garzik

[netdrvr] convert sbmac tx to spin_lock_irqsave to prevent early IRQ enable

Netpoll will call the interrupt handler with interrupts
disabled when using kgdboe, so spin_lock_irqsave() should
be used instead of spin_lock_irq() to prevent interrupts
from being incorrectly enabled.
Signed-off-by: NWeiwei Wang <weiwei.wang@windriver.com>
Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
上级 31578140
...@@ -2069,9 +2069,10 @@ static irqreturn_t sbmac_intr(int irq,void *dev_instance) ...@@ -2069,9 +2069,10 @@ static irqreturn_t sbmac_intr(int irq,void *dev_instance)
static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev) static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev)
{ {
struct sbmac_softc *sc = netdev_priv(dev); struct sbmac_softc *sc = netdev_priv(dev);
unsigned long flags;
/* lock eth irq */ /* lock eth irq */
spin_lock_irq (&sc->sbm_lock); spin_lock_irqsave(&sc->sbm_lock, flags);
/* /*
* Put the buffer on the transmit ring. If we * Put the buffer on the transmit ring. If we
...@@ -2081,14 +2082,14 @@ static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -2081,14 +2082,14 @@ static int sbmac_start_tx(struct sk_buff *skb, struct net_device *dev)
if (sbdma_add_txbuffer(&(sc->sbm_txdma),skb)) { if (sbdma_add_txbuffer(&(sc->sbm_txdma),skb)) {
/* XXX save skb that we could not send */ /* XXX save skb that we could not send */
netif_stop_queue(dev); netif_stop_queue(dev);
spin_unlock_irq(&sc->sbm_lock); spin_unlock_irqrestore(&sc->sbm_lock, flags);
return 1; return 1;
} }
dev->trans_start = jiffies; dev->trans_start = jiffies;
spin_unlock_irq (&sc->sbm_lock); spin_unlock_irqrestore(&sc->sbm_lock, flags);
return 0; return 0;
} }
...@@ -2568,14 +2569,15 @@ static void sbmac_mii_poll(struct net_device *dev) ...@@ -2568,14 +2569,15 @@ static void sbmac_mii_poll(struct net_device *dev)
static void sbmac_tx_timeout (struct net_device *dev) static void sbmac_tx_timeout (struct net_device *dev)
{ {
struct sbmac_softc *sc = netdev_priv(dev); struct sbmac_softc *sc = netdev_priv(dev);
unsigned long flags;
spin_lock_irq (&sc->sbm_lock); spin_lock_irqsave(&sc->sbm_lock, flags);
dev->trans_start = jiffies; dev->trans_start = jiffies;
dev->stats.tx_errors++; dev->stats.tx_errors++;
spin_unlock_irq (&sc->sbm_lock); spin_unlock_irqrestore(&sc->sbm_lock, flags);
printk (KERN_WARNING "%s: Transmit timed out\n",dev->name); printk (KERN_WARNING "%s: Transmit timed out\n",dev->name);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册