diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-09-11 22:55:32 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-24 18:54:49 -0400 |
commit | cf8280ee7be3aaf44d32e389f15c725b850e5e32 (patch) | |
tree | 3511ef0b19370597c7bd5fbe43a74d563522adeb /drivers/net/ixgbe/ixgbe_82598.c | |
parent | ce94bf469edf84228771b58489944cf654aeb496 (diff) |
ixgbe: Update watchdog thread to accomodate longerlink_up events
This patch updates the link_up code and watchdog thread so that link_up
doesn't cause stack overflows due to long waits in interrupt context.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82598.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82598.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index ba09063260d9..1e014bcc72d9 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -47,7 +47,8 @@ static s32 ixgbe_get_copper_link_settings_82598(struct ixgbe_hw *hw, | |||
47 | static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw); | 47 | static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw); |
48 | static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw); | 48 | static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw); |
49 | static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed, | 49 | static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed, |
50 | bool *link_up); | 50 | bool *link_up, |
51 | bool link_up_wait_to_complete); | ||
51 | static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, u32 speed, | 52 | static s32 ixgbe_setup_mac_link_speed_82598(struct ixgbe_hw *hw, u32 speed, |
52 | bool autoneg, | 53 | bool autoneg, |
53 | bool autoneg_wait_to_complete); | 54 | bool autoneg_wait_to_complete); |
@@ -277,20 +278,36 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw) | |||
277 | * @hw: pointer to hardware structure | 278 | * @hw: pointer to hardware structure |
278 | * @speed: pointer to link speed | 279 | * @speed: pointer to link speed |
279 | * @link_up: true is link is up, false otherwise | 280 | * @link_up: true is link is up, false otherwise |
281 | * @link_up_wait_to_complete: bool used to wait for link up or not | ||
280 | * | 282 | * |
281 | * Reads the links register to determine if link is up and the current speed | 283 | * Reads the links register to determine if link is up and the current speed |
282 | **/ | 284 | **/ |
283 | static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed, | 285 | static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, u32 *speed, |
284 | bool *link_up) | 286 | bool *link_up, |
287 | bool link_up_wait_to_complete) | ||
285 | { | 288 | { |
286 | u32 links_reg; | 289 | u32 links_reg; |
290 | u32 i; | ||
287 | 291 | ||
288 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); | 292 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); |
289 | 293 | ||
290 | if (links_reg & IXGBE_LINKS_UP) | 294 | if (link_up_wait_to_complete) { |
291 | *link_up = true; | 295 | for (i = 0; i < IXGBE_LINK_UP_TIME; i++) { |
292 | else | 296 | if (links_reg & IXGBE_LINKS_UP) { |
293 | *link_up = false; | 297 | *link_up = true; |
298 | break; | ||
299 | } else { | ||
300 | *link_up = false; | ||
301 | } | ||
302 | msleep(100); | ||
303 | links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); | ||
304 | } | ||
305 | } else { | ||
306 | if (links_reg & IXGBE_LINKS_UP) | ||
307 | *link_up = true; | ||
308 | else | ||
309 | *link_up = false; | ||
310 | } | ||
294 | 311 | ||
295 | if (links_reg & IXGBE_LINKS_SPEED) | 312 | if (links_reg & IXGBE_LINKS_SPEED) |
296 | *speed = IXGBE_LINK_SPEED_10GB_FULL; | 313 | *speed = IXGBE_LINK_SPEED_10GB_FULL; |