Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298746
b: refs/heads/master
c: bb9e44d
h: refs/heads/master
v: v3
  • Loading branch information
Bruce Allan authored and Jeff Kirsher committed Apr 3, 2012
1 parent 0fd06db commit daa6b36
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aacc1bea190d731755a65cb8ec31dd756f4e263e
refs/heads/master: bb9e44d0d0f45da356c39e485edacff6e14ba961
6 changes: 6 additions & 0 deletions trunk/drivers/net/ethernet/intel/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ struct e1000_info;
/* Time to wait before putting the device into D3 if there's no link (in ms). */
#define LINK_TIMEOUT 100

/*
* Count for polling __E1000_RESET condition every 10-20msec.
* Experimentation has shown the reset can take approximately 210msec.
*/
#define E1000_CHECK_RESET_COUNT 25

#define DEFAULT_RDTR 0
#define DEFAULT_RADV 8
#define BURST_RDTR 0x20
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3968,6 +3968,10 @@ static int e1000_close(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct pci_dev *pdev = adapter->pdev;
int count = E1000_CHECK_RESET_COUNT;

while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
usleep_range(10000, 20000);

WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));

Expand Down Expand Up @@ -5472,6 +5476,11 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake,
netif_device_detach(netdev);

if (netif_running(netdev)) {
int count = E1000_CHECK_RESET_COUNT;

while (test_bit(__E1000_RESETTING, &adapter->state) && count--)
usleep_range(10000, 20000);

WARN_ON(test_bit(__E1000_RESETTING, &adapter->state));
e1000e_down(adapter);
e1000_free_irq(adapter);
Expand Down

0 comments on commit daa6b36

Please sign in to comment.