Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214754
b: refs/heads/master
c: 338c15e
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Brandeburg authored and David S. Miller committed Sep 23, 2010
1 parent 0e3a1de commit b1a8d63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5cf42fcda0fdddfe7f5ea8629cb7b820bf7e91ab
refs/heads/master: 338c15e470d818f215d651505dc169d4e92f36a4
20 changes: 19 additions & 1 deletion trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,21 @@ void e1000_down(struct e1000_adapter *adapter)
e1000_clean_all_rx_rings(adapter);
}

void e1000_reinit_safe(struct e1000_adapter *adapter)
{
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
msleep(1);
rtnl_lock();
e1000_down(adapter);
e1000_up(adapter);
rtnl_unlock();
clear_bit(__E1000_RESETTING, &adapter->flags);
}

void e1000_reinit_locked(struct e1000_adapter *adapter)
{
/* if rtnl_lock is not held the call path is bogus */
ASSERT_RTNL();
WARN_ON(in_interrupt());
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
msleep(1);
Expand Down Expand Up @@ -2247,7 +2260,10 @@ static void e1000_update_phy_info_task(struct work_struct *work)
struct e1000_adapter,
phy_info_task);
struct e1000_hw *hw = &adapter->hw;

rtnl_lock();
e1000_phy_get_info(hw, &adapter->phy_info);
rtnl_unlock();
}

/**
Expand All @@ -2273,6 +2289,7 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work)
struct net_device *netdev = adapter->netdev;
u32 tctl;

rtnl_lock();
if (atomic_read(&adapter->tx_fifo_stall)) {
if ((er32(TDT) == er32(TDH)) &&
(er32(TDFT) == er32(TDFH)) &&
Expand All @@ -2293,6 +2310,7 @@ static void e1000_82547_tx_fifo_stall_task(struct work_struct *work)
mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1);
}
}
rtnl_unlock();
}

bool e1000_has_link(struct e1000_adapter *adapter)
Expand Down Expand Up @@ -3160,7 +3178,7 @@ static void e1000_reset_task(struct work_struct *work)
struct e1000_adapter *adapter =
container_of(work, struct e1000_adapter, reset_task);

e1000_reinit_locked(adapter);
e1000_reinit_safe(adapter);
}

/**
Expand Down

0 comments on commit b1a8d63

Please sign in to comment.