diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2010-09-22 14:22:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-23 17:33:37 -0400 |
commit | 5cf42fcda0fdddfe7f5ea8629cb7b820bf7e91ab (patch) | |
tree | bd9221e2e5d612bebda4a1a29efc42682a7a8f5f /drivers/net/e1000/e1000_main.c | |
parent | 7b872a55c40b7e6f5e257c252f96dde911bd7b2f (diff) |
e1000: use work queues
E1000 is using several timers that in a follow on patch
will need to acquire the rtnl_lock in order to be safe.
This patch moves the timer bodies into work queues which
will allow the next patch to add rtnl_lock.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index a1daceadca84..5b4c6c061414 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -123,8 +123,10 @@ static void e1000_clean_rx_ring(struct e1000_adapter *adapter, | |||
123 | struct e1000_rx_ring *rx_ring); | 123 | struct e1000_rx_ring *rx_ring); |
124 | static void e1000_set_rx_mode(struct net_device *netdev); | 124 | static void e1000_set_rx_mode(struct net_device *netdev); |
125 | static void e1000_update_phy_info(unsigned long data); | 125 | static void e1000_update_phy_info(unsigned long data); |
126 | static void e1000_update_phy_info_task(struct work_struct *work); | ||
126 | static void e1000_watchdog(unsigned long data); | 127 | static void e1000_watchdog(unsigned long data); |
127 | static void e1000_82547_tx_fifo_stall(unsigned long data); | 128 | static void e1000_82547_tx_fifo_stall(unsigned long data); |
129 | static void e1000_82547_tx_fifo_stall_task(struct work_struct *work); | ||
128 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, | 130 | static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, |
129 | struct net_device *netdev); | 131 | struct net_device *netdev); |
130 | static struct net_device_stats * e1000_get_stats(struct net_device *netdev); | 132 | static struct net_device_stats * e1000_get_stats(struct net_device *netdev); |
@@ -1047,7 +1049,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
1047 | adapter->phy_info_timer.function = e1000_update_phy_info; | 1049 | adapter->phy_info_timer.function = e1000_update_phy_info; |
1048 | adapter->phy_info_timer.data = (unsigned long)adapter; | 1050 | adapter->phy_info_timer.data = (unsigned long)adapter; |
1049 | 1051 | ||
1052 | INIT_WORK(&adapter->fifo_stall_task, e1000_82547_tx_fifo_stall_task); | ||
1050 | INIT_WORK(&adapter->reset_task, e1000_reset_task); | 1053 | INIT_WORK(&adapter->reset_task, e1000_reset_task); |
1054 | INIT_WORK(&adapter->phy_info_task, e1000_update_phy_info_task); | ||
1051 | 1055 | ||
1052 | e1000_check_options(adapter); | 1056 | e1000_check_options(adapter); |
1053 | 1057 | ||
@@ -2234,6 +2238,14 @@ static void e1000_set_rx_mode(struct net_device *netdev) | |||
2234 | static void e1000_update_phy_info(unsigned long data) | 2238 | static void e1000_update_phy_info(unsigned long data) |
2235 | { | 2239 | { |
2236 | struct e1000_adapter *adapter = (struct e1000_adapter *)data; | 2240 | struct e1000_adapter *adapter = (struct e1000_adapter *)data; |
2241 | schedule_work(&adapter->phy_info_task); | ||
2242 | } | ||
2243 | |||
2244 | static void e1000_update_phy_info_task(struct work_struct *work) | ||
2245 | { | ||
2246 | struct e1000_adapter *adapter = container_of(work, | ||
2247 | struct e1000_adapter, | ||
2248 | phy_info_task); | ||
2237 | struct e1000_hw *hw = &adapter->hw; | 2249 | struct e1000_hw *hw = &adapter->hw; |
2238 | e1000_phy_get_info(hw, &adapter->phy_info); | 2250 | e1000_phy_get_info(hw, &adapter->phy_info); |
2239 | } | 2251 | } |
@@ -2242,10 +2254,21 @@ static void e1000_update_phy_info(unsigned long data) | |||
2242 | * e1000_82547_tx_fifo_stall - Timer Call-back | 2254 | * e1000_82547_tx_fifo_stall - Timer Call-back |
2243 | * @data: pointer to adapter cast into an unsigned long | 2255 | * @data: pointer to adapter cast into an unsigned long |
2244 | **/ | 2256 | **/ |
2245 | |||
2246 | static void e1000_82547_tx_fifo_stall(unsigned long data) | 2257 | static void e1000_82547_tx_fifo_stall(unsigned long data) |
2247 | { | 2258 | { |
2248 | struct e1000_adapter *adapter = (struct e1000_adapter *)data; | 2259 | struct e1000_adapter *adapter = (struct e1000_adapter *)data; |
2260 | schedule_work(&adapter->fifo_stall_task); | ||
2261 | } | ||
2262 | |||
2263 | /** | ||
2264 | * e1000_82547_tx_fifo_stall_task - task to complete work | ||
2265 | * @work: work struct contained inside adapter struct | ||
2266 | **/ | ||
2267 | static void e1000_82547_tx_fifo_stall_task(struct work_struct *work) | ||
2268 | { | ||
2269 | struct e1000_adapter *adapter = container_of(work, | ||
2270 | struct e1000_adapter, | ||
2271 | fifo_stall_task); | ||
2249 | struct e1000_hw *hw = &adapter->hw; | 2272 | struct e1000_hw *hw = &adapter->hw; |
2250 | struct net_device *netdev = adapter->netdev; | 2273 | struct net_device *netdev = adapter->netdev; |
2251 | u32 tctl; | 2274 | u32 tctl; |