ixgbe: fix issues with failing to detect insert of unsupported module
Subsystems (2)
PATCH 1/4 ixgbe: fix issues with failing to detect insert of unsupported module
From: Don Skidmore <[email protected]>
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.
---
drivers/net/ixgbe/ixgbe_main.c | 8 ++++++-- drivers/net/ixgbe/ixgbe_phy.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +6 -2
@@ -3724,7 +3724,7 @@ static void ixgbe_sfp_task(struct work_struct *work)if ((hw->phy.type == ixgbe_phy_nl) && (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) {s32 ret = hw->phy.ops.identify_sfp (hw); -if (ret) +if (ret ==IXGBE_ERR_SFP_NOT_PRESENT ) goto reschedule; ret = hw->phy.ops.reset (hw);if (ret ==IXGBE_ERR_SFP_NOT_SUPPORTED ) {
@@ -4534,13 +4534,17 @@ static void ixgbe_sfp_config_module_task(struct work_struct *work)u32 err; adapter->flags |=IXGBE_FLAG_IN_SFP_MOD_TASK ; + +/* Time for electrical oscillations to settle down */ +msleep (100 ); err = hw->phy.ops.identify_sfp (hw); +if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) {dev_err (&adapter->pdev->dev,"failed to initialize because " "an unsupported SFP+ module type was detected.\n" "Reload the driver after installing a supported " "module.\n" ); -ixgbe_down (adapter); +unregister_netdev (adapter->netdev);return ; } hw->mac.ops.setup_sfp (hw);
drivers/net/ixgbe/ixgbe_phy.c +3 -0
@@ -60,6 +60,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)if (hw->phy.type == ixgbe_phy_unknown) {for (phy_addr =0 ; phy_addr <IXGBE_MAX_PHY_ADDR ; phy_addr++) { + hw->phy.mdio.prtad = phy_addr;if (mdio45_probe (&hw->phy.mdio, phy_addr) ==0 ) {ixgbe_get_phy_id (hw); hw->phy.type =
@@ -68,6 +69,8 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)break ; } } +/* clear value if nothing found */ + hw->phy.mdio.prtad =0 ; }else { status =0 ; }
PATCH 2/4 ixgbe: fix regression on some 82598 adapters
From: Don Skidmore <[email protected]>
The change to check the SFP+ module again on open() was causing the XFP (non-SFP+) adapters to be rejected. We only want to try and re-identify the SFP+ module if the original probe found that this device was an SFP+ device. So for this code path (driver loaded with SFP module, module inserted, ifconfig up of the device) the type will be ixgbe_phy_unknown for an unidentified SFP+ module. So we only check if that is the case.
This problem also shows up on Copper devices.
---
drivers/net/ixgbe/ixgbe_main.c | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +14 -10
@@ -2697,19 +2697,23 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)/* * For hot-pluggable SFP+ devices, a new SFP+ module may have -* arrived before interrupts were enabled. We need to kick off -* the SFP+ module setup first, then try to bring up link. +* arrived before interrupts were enabled but after probe. Such +* devices wouldn't have their type identified yet. We need to +* kick off the SFP+ module setup first, then try to bring up link. * If we're not hot-pluggable SFP+, we just need to configure link * and bring it up. */ - err = hw->phy.ops.identify (hw); -if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -dev_err (&adapter->pdev->dev,"failed to initialize because " -"an unsupported SFP+ module type was detected.\n" -"Reload the driver after installing a supported " -"module.\n" ); -ixgbe_down (adapter); -return err; +if (hw->phy.type == ixgbe_phy_unknown) { + err = hw->phy.ops.identify (hw); +if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { +dev_err (&adapter->pdev->dev,"failed to initialize " +"because an unsupported SFP+ module type " +"was detected.\n" +"Reload the driver after installing a " +"supported module.\n" ); +ixgbe_down (adapter); +return err; + } }if (ixgbe_is_sfp (hw)) {
Re: [net-2.6 PATCH 2/4] ixgbe: fix regression on some 82598 adapters
From: Jeff Kirsher <[email protected]>
Date: Thu, 02 Jul 2009 15:50:31 -0700
Quoted 11 lines
From: Don Skidmore <[email protected]>
The change to check the SFP+ module again on
open()was causing the XFP (non-SFP+) adapters to be rejected. We only want to try and re-identify the SFP+ module if the original probe found that this device was an SFP+ device. So for this code path (driver loaded with SFP module, module inserted, ifconfig up of the device) the type will beixgbe_phy_unknownfor an unidentified SFP+ module. So we only check if that is the case.
Quoted 5 lines
This problem also shows up on Copper devices.
Signed-off-by Peter P Waskiewicz Jr <[email protected]>Signed-off-by Don Skidmore <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 3/4 ixgbe: fix inconsistent SFP/SFP+ failure results.
In reply to Jeff KirsherFrom: Don Skidmore <[email protected]>
Currently if we loaded the driver, insert an unsupported module, and then attempt to "ifconfig up" the device it will be brought down but the netdev would not be unregistered. This behavior is different than all other code paths. This patch corrects that by down'ing the device and then scheduling the sfp_config_module_task tasklet. The tasklet will detect this condition (like it does with other code paths) and do the unregister_netdev().
I also removed the log message as this condition (an unsupported SFP+ module) will be logged in sfp_config_module_task.
---
drivers/net/ixgbe/ixgbe_main.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/ixgbe/ixgbe_main.c +5 -5
@@ -2706,12 +2706,12 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)if (hw->phy.type == ixgbe_phy_unknown) { err = hw->phy.ops.identify (hw);if (err ==IXGBE_ERR_SFP_NOT_SUPPORTED ) { -dev_err (&adapter->pdev->dev,"failed to initialize " -"because an unsupported SFP+ module type " -"was detected.\n" -"Reload the driver after installing a " -"supported module.\n" ); +/* +* Take the device down and schedule the sfp tasklet +* which will unregister_netdev and log it. +*/ ixgbe_down (adapter); +schedule_work (&adapter->sfp_config_module_task);return err; } }
Re: [net-2.6 PATCH 3/4] ixgbe: fix inconsistent SFP/SFP+ failure results.
From: Jeff Kirsher <[email protected]>
Date: Thu, 02 Jul 2009 15:50:52 -0700
Quoted 10 lines
From: Don Skidmore <[email protected]>
Currently if we loaded the driver, insert an unsupported module, and then attempt to "ifconfig up" the device it will be brought down but the netdev would not be unregistered. This behavior is different than all other code paths. This patch corrects that by down'ing the device and then scheduling the
sfp_config_module_tasktasklet. The tasklet will detect this condition (like it does with other code paths) and do theunregister_netdev().
Quoted 5 lines
I also removed the log message as this condition (an unsupported SFP+ module) will be logged in
sfp_config_module_task.Signed-off-by Don Skidmore <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.
PATCH 4/4 ixgbe: Not allow 8259x unsupported wol options change from ethtool
In reply to Jeff KirsherFrom: Mallikarjuna R Chilakala <[email protected]>
Wake-on-lan is currently only supported by 82599 KX4 devices, in all other cases return a proper value from ixgbe_wol_exclusion function call. Otherwise from ethtool we will be able to change wol options of unsupported 8259x devices.
---
drivers/net/ixgbe/ixgbe_ethtool.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/ixgbe/ixgbe_ethtool.c +0 -1
@@ -1830,7 +1830,6 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,break ;default : wol->supported =0 ; - retval =0 ; }return retval;
Re: [net-2.6 PATCH 4/4] ixgbe: Not allow 8259x unsupported wol options change from ethtool
From: Jeff Kirsher <[email protected]>
Date: Thu, 02 Jul 2009 15:51:10 -0700
Quoted 10 lines
From: Mallikarjuna R Chilakala <[email protected]>
Wake-on-lan is currently only supported by 82599 KX4 devices, in all other cases return a proper value from
ixgbe_wol_exclusionfunction call. Otherwise from ethtool we will be able to change wol options of unsupported 8259x devices.Signed-off-by Mallikarjuna R Chilakala <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>---
Applied.
From: Jeff Kirsher <[email protected]>
Date: Thu, 02 Jul 2009 15:50:12 -0700
Quoted 10 lines
From: Don Skidmore <[email protected]>
Several small fixes around negative test case of the insertion of a
IXGBE_ERR_NOT_SUPPORTEDmodule.-
mdio45_probecall 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 thephy_idand phy.type correctly now.
Quoted 8 lines
- 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_taskthat allowsNOT_SUPPORTEDcondition to be recognized.Signed-off-by Don Skidmore <[email protected]>Signed-off-by Jeff Kirsher <[email protected]>
Applied.