Skip to contentSkip to conversation

E1000: Fix ifdown hang in git-2.6.24

PATCH Applied Krishna Kumar 3 participants 5 messages Aug 23, 2007 – Aug 25, 2007

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

PATCH 1/2 E1000: Fix ifdown hang in git-2.6.24

Doing napi_disable twice hangs "ifdown" of the device. e1000_down is the common place to call napi_disable.

---
 e1000_main.c |    4 ----
 1 files changed, 4 deletions(-)
drivers/net/e1000/e1000_main.c +0 -4
diff -ruNp org/drivers/net/e1000/e1000_main.c new/drivers/net/e1000/e1000_main.c
@@ -1477,10 +1477,6 @@ e1000_close(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
-#ifdef CONFIG_E1000_NAPI
-	napi_disable(&adapter->napi);
-#endif
-
 	WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
 	e1000_down(adapter);
 	e1000_power_down_phy(adapter);
#1 lore raw

RFC PATCH 2/2 E1000: Fix hang in netdev_wait_allrefs()

After applying patch1, I started getting "waiting for count" messages when doing ifdown. Not sure if this is the right fix since the count was already showing as -1 in that message, but this patch fixes the problem.

---
 e1000_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/e1000/e1000_main.c +2 -1
diff -ruNp new/drivers/net/e1000/e1000_main.c new2/drivers/net/e1000/e1000_main.c
@@ -1219,12 +1219,13 @@ e1000_remove(struct pci_dev *pdev)
 	 * would have already happened in close and is redundant. */
 	e1000_release_hw_control(adapter);
 
-	unregister_netdev(netdev);
 #ifdef CONFIG_E1000_NAPI
 	for (i = 0; i < adapter->num_rx_queues; i++)
 		dev_put(&adapter->polling_netdev[i]);
 #endif
 
+	unregister_netdev(netdev);
+
 	if (!e1000_check_phy_reset_block(&adapter->hw))
 		e1000_phy_hw_reset(&adapter->hw);
 
Acked-by on v1 1/2
#3 lore raw
In reply to Krishna Kumar
Quoted 12 lines · Krishna Kumar

Doing napi_disable twice hangs "ifdown" of the device. e1000_down is the common place to call napi_disable.

---
 e1000_main.c |    4 ----
 1 files changed, 4 deletions(-)

diff -ruNp org/drivers/net/e1000/e1000_main.c new/drivers/net/e1000/e1000_main.c

drivers/net/e1000/e1000_main.c e1000_close(struct net_device *netdev) · line 1482

Quoted 10 lines
drivers/net/e1000/e1000_main.c +0 -4
@@ -1477,10 +1477,6 @@ e1000_close(struct net_device *netdev)
 {
 	struct e1000_adapter *adapter = netdev_priv(netdev);
 
-#ifdef CONFIG_E1000_NAPI
-	napi_disable(&adapter->napi);
-#endif
-
 	WARN_ON(test_bit(__E1000_RESETTING, &adapter->flags));
 	e1000_down(adapter);
 	e1000_power_down_phy(adapter);

I pushed this change to akpm for -mm as well in e1000e...

Thanks Krishna,

Auke

maintainer
#2 lore raw

Re: [PATCH 2/2] [RFC] E1000: Fix hang in netdev_wait_allrefs()

In reply to Krishna Kumar

From: Krishna Kumar <[email protected]>
Date: Thu, 23 Aug 2007 14:34:31 +0530

Quoted 5 lines

After applying patch1, I started getting "waiting for count" messages when doing ifdown. Not sure if this is the right fix since the count was already showing as -1 in that message, but this patch fixes the problem.

I've applied this because is fixes the problem and there have be no objections coming along with better fixes :)

If this is bogus we can rever it and put in a more proper fix.