aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/e1000e/e1000.h6
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 86cdd4793992..b83897f76ee3 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -161,6 +161,12 @@ struct e1000_info;
161/* Time to wait before putting the device into D3 if there's no link (in ms). */ 161/* Time to wait before putting the device into D3 if there's no link (in ms). */
162#define LINK_TIMEOUT 100 162#define LINK_TIMEOUT 100
163 163
164/*
165 * Count for polling __E1000_RESET condition every 10-20msec.
166 * Experimentation has shown the reset can take approximately 210msec.
167 */
168#define E1000_CHECK_RESET_COUNT 25
169
164#define DEFAULT_RDTR 0 170#define DEFAULT_RDTR 0
165#define DEFAULT_RADV 8 171#define DEFAULT_RADV 8
166#define BURST_RDTR 0x20 172#define BURST_RDTR 0x20
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 2c38a65ade87..6878601f20c5 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3968,6 +3968,10 @@ static int e1000_close(struct net_device *netdev)
3968{ 3968{
3969 struct e1000_adapter *adapter = netdev_priv(netdev); 3969 struct e1000_adapter *adapter = netdev_priv(netdev);
3970 struct pci_dev *pdev = adapter->pdev; 3970 struct pci_dev *pdev = adapter->pdev;
3971 int count = E1000_CHECK_RESET_COUNT;
3972
3973 while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
3974 usleep_range(10000, 20000);
3971 3975
3972 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 3976 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
3973 3977
@@ -5472,6 +5476,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
5472 netif_device_detach(netdev); 5476 netif_device_detach(netdev);
5473 5477
5474 if (netif_running(netdev)) { 5478 if (netif_running(netdev)) {
5479 int count = E1000_CHECK_RESET_COUNT;
5480
5481 while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
5482 usleep_range(10000, 20000);
5483
5475 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state)); 5484 WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
5476 e1000e_down(adapter); 5485 e1000e_down(adapter);
5477 e1000_free_irq(adapter); 5486 e1000_free_irq(adapter);