diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2009-07-02 08:50:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-03 22:10:55 -0400 |
commit | 63d6e1d80a8c3118be2ca0f1f21ba883f282060c (patch) | |
tree | a1bd149312f64d88b7e1acf585568964b6ed805f /drivers | |
parent | e332471c035708441de89d4c59f7f7cdc2700c0d (diff) |
ixgbe: fix issues with failing to detect insert of unsupported module
Several small fixes around negative test case of the insertion of a
IXGBE_ERR_NOT_SUPPORTED module.
- mdio45_probe call was always failing due to mdio.prtad not being
set. The function set to mdio.mdio_read was still working as we just
happen to always be at prtad == 0. This will allow us to set the phy_id
and phy.type correctly now.
- There was timing issue with i2c calls when initiated from a tasklet.
A small delay was added to allow the electrical oscillation to calm down.
- Logic change in ixgbe_sfp_task that allows NOT_SUPPORTED condition
to be recognized.
Signed-off-by: Don Skidmore <donald.c.skidmore@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')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.c | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 5588ef493a3d..aaf482c0d520 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3724,7 +3724,7 @@ static void ixgbe_sfp_task(struct work_struct *work) | |||
3724 | if ((hw->phy.type == ixgbe_phy_nl) && | 3724 | if ((hw->phy.type == ixgbe_phy_nl) && |
3725 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { | 3725 | (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { |
3726 | s32 ret = hw->phy.ops.identify_sfp(hw); | 3726 | s32 ret = hw->phy.ops.identify_sfp(hw); |
3727 | if (ret) | 3727 | if (ret == IXGBE_ERR_SFP_NOT_PRESENT) |
3728 | goto reschedule; | 3728 | goto reschedule; |
3729 | ret = hw->phy.ops.reset(hw); | 3729 | ret = hw->phy.ops.reset(hw); |
3730 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 3730 | if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
@@ -4534,13 +4534,17 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work) | |||
4534 | u32 err; | 4534 | u32 err; |
4535 | 4535 | ||
4536 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; | 4536 | adapter->flags |= IXGBE_FLAG_IN_SFP_MOD_TASK; |
4537 | |||
4538 | /* Time for electrical oscillations to settle down */ | ||
4539 | msleep(100); | ||
4537 | err = hw->phy.ops.identify_sfp(hw); | 4540 | err = hw->phy.ops.identify_sfp(hw); |
4541 | |||
4538 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { | 4542 | if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4539 | dev_err(&adapter->pdev->dev, "failed to initialize because " | 4543 | dev_err(&adapter->pdev->dev, "failed to initialize because " |
4540 | "an unsupported SFP+ module type was detected.\n" | 4544 | "an unsupported SFP+ module type was detected.\n" |
4541 | "Reload the driver after installing a supported " | 4545 | "Reload the driver after installing a supported " |
4542 | "module.\n"); | 4546 | "module.\n"); |
4543 | ixgbe_down(adapter); | 4547 | unregister_netdev(adapter->netdev); |
4544 | return; | 4548 | return; |
4545 | } | 4549 | } |
4546 | hw->mac.ops.setup_sfp(hw); | 4550 | hw->mac.ops.setup_sfp(hw); |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 453e966762f0..9ecad17522c3 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -60,6 +60,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
60 | 60 | ||
61 | if (hw->phy.type == ixgbe_phy_unknown) { | 61 | if (hw->phy.type == ixgbe_phy_unknown) { |
62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { | 62 | for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) { |
63 | hw->phy.mdio.prtad = phy_addr; | ||
63 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { | 64 | if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) { |
64 | ixgbe_get_phy_id(hw); | 65 | ixgbe_get_phy_id(hw); |
65 | hw->phy.type = | 66 | hw->phy.type = |
@@ -68,6 +69,8 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw) | |||
68 | break; | 69 | break; |
69 | } | 70 | } |
70 | } | 71 | } |
72 | /* clear value if nothing found */ | ||
73 | hw->phy.mdio.prtad = 0; | ||
71 | } else { | 74 | } else { |
72 | status = 0; | 75 | status = 0; |
73 | } | 76 | } |