Skip to contentSkip to conversation

cpmac: prevent fatal exception in cpmac_end_xmit

PATCH Applied Florian Fainelli 2 participants 3 messages May 31, 2009 – Jun 1, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 cpmac: prevent fatal exception in cpmac_end_xmit

From: Stefan Weil <[email protected]>

We should not be stopping the subqueues in cpmac_end_xmit but rather test the status of them. Replace the calls to netif_subqueue_stop by __netif_subqueue_stopped. This fixes an unrecoverable exception from happening when running the driver.

---

drivers/net/cpmac.c +2 -2
index 08e2f67..58afafb 100644
@@ -615,13 +615,13 @@ static void cpmac_end_xmit(struct net_device *dev, int queue)
 
 		dev_kfree_skb_irq(desc->skb);
 		desc->skb = NULL;
-		if (netif_subqueue_stopped(dev, queue))
+		if (__netif_subqueue_stopped(dev, queue))
 			netif_wake_subqueue(dev, queue);
 	} else {
 		if (netif_msg_tx_err(priv) && net_ratelimit())
 			printk(KERN_WARNING
 			       "%s: end_xmit: spurious interrupt\n", dev->name);
-		if (netif_subqueue_stopped(dev, queue))
+		if (__netif_subqueue_stopped(dev, queue))
 			netif_wake_subqueue(dev, queue);
 	}
 }
maintainer Applied
#1 lore raw

From: Florian Fainelli <[email protected]>
Date: Sun, 31 May 2009 22:59:15 +0200

Quoted 10 lines

From: Stefan Weil <[email protected]>

We should not be stopping the subqueues in cpmac_end_xmit but rather test the status of them. Replace the calls to netif_subqueue_stop by __netif_subqueue_stopped. This fixes an unrecoverable exception from happening when running the driver.

Applied, but this commit message was completely wrong and therefore misleading to anyone trying to track down why this change was made.

The problem is that netif_subqueue_stopped() takes a SKB pointer, whereas we're passing in an integer queue index here.

Therefore, merely providing the obvious compile warning that was produced by this incorrect argument type would have explained everything, and accurately.

#2 lore raw

Hi David,

Le Monday 01 June 2009 11:58:18 David Miller, vous avez écrit :

Quoted 18 lines

From: Florian Fainelli <[email protected]>
Date: Sun, 31 May 2009 22:59:15 +0200

Quoted 10 lines

From: Stefan Weil <[email protected]>

We should not be stopping the subqueues in cpmac_end_xmit but rather test the status of them. Replace the calls to netif_subqueue_stop by __netif_subqueue_stopped. This fixes an unrecoverable exception from happening when running the driver.

Applied, but this commit message was completely wrong and therefore misleading to anyone trying to track down why this change was made.

Quoted 7 lines

The problem is that netif_subqueue_stopped() takes a SKB pointer, whereas we're passing in an integer queue index here.

Therefore, merely providing the obvious compile warning that was produced by this incorrect argument type would have explained everything, and accurately.

You are right I should have given you the right description. Thanks for applying it anyway.

Signature · 4 lines
Best regards, Florian Fainelli
Email : [email protected]
http://openwrt.org
-------------------------------