Redhat errata kernel addresses tg3 driver lockup

Amit_Bhutani@Dell.com Amit_Bhutani at Dell.com
Wed Nov 20 14:15:00 CST 2002


Red Hat has re-opened BUG# 69920("Kernel Crashes in TG3 Driver")on Bugzilla
just today morning after I and one other guy after me commented on the
diffs. They have already posted a patch that they think fixes the problem. I
have pasted the patch below. Anyone willing to take a shot at it, please go
ahead and let the rest of us know. 

- Amit Bhutani

p.s: Try it at your own risk of course

--- drivers/net/tg3.c.~1~	Tue Nov 19 15:30:41 2002
+++ drivers/net/tg3.c	Tue Nov 19 15:31:34 2002
@@ -2367,6 +2367,7 @@
 	unsigned int i;
 	u32 len, entry, base_flags, mss;
 	int would_hit_hwbug;
+	unsigned long flags;
 
 	len = (skb->len - skb->data_len);
 
@@ -2389,12 +2390,12 @@
 	 * So we really do need to disable interrupts when taking
 	 * tx_lock here.
 	 */
-	spin_lock_irq(&tp->tx_lock);
+	spin_lock_irqsave(&tp->tx_lock, flags);
 
 	/* This is a hard error, log it. */
 	if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1)))
{
 		netif_stop_queue(dev);
-		spin_unlock_irq(&tp->tx_lock);
+		spin_unlock_irqrestore(&tp->tx_lock, flags);
 		printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue
awake!\n",
 		       dev->name);
 		return 1;
@@ -2535,7 +2536,7 @@
 		netif_stop_queue(dev);
 
 out_unlock:
-	spin_unlock_irq(&tp->tx_lock);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
 
 	dev->trans_start = jiffies;
 
@@ -2547,6 +2548,7 @@
 	struct tg3 *tp = dev->priv;
 	dma_addr_t mapping;
 	u32 len, entry, base_flags, mss;
+	unsigned long flags;
 
 	len = (skb->len - skb->data_len);
 
@@ -2569,12 +2571,12 @@
 	 * So we really do need to disable interrupts when taking
 	 * tx_lock here.
 	 */
-	spin_lock_irq(&tp->tx_lock);
+	spin_lock_irqsave(&tp->tx_lock, flags);
 
 	/* This is a hard error, log it. */
 	if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1)))
{
 		netif_stop_queue(dev);
-		spin_unlock_irq(&tp->tx_lock);
+		spin_unlock_irqrestore(&tp->tx_lock, flags);
 		printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue
awake!\n",
 		       dev->name);
 		return 1;
@@ -2665,7 +2667,7 @@
 	if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1))
 		netif_stop_queue(dev);
 
-	spin_unlock_irq(&tp->tx_lock);
+	spin_unlock_irqrestore(&tp->tx_lock, flags);
 
 	dev->trans_start = jiffies;
 





More information about the Linux-PowerEdge mailing list