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

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

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.

Signed-off-by: Krishna Kumar <[email-masked]>
---
 e1000_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -ruNp new/drivers/net/e1000/e1000_main.c new2/drivers/net/e1000/e1000_main.c
--- new/drivers/net/e1000/e1000_main.c	2007-08-23 13:32:34.000000000 +0530
+++ new2/drivers/net/e1000/e1000_main.c	2007-08-23 14:28:12.000000000 +0530
@@ -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);