2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 18:53:52 +08:00

ixgbe: fix inconsistent SFP/SFP+ failure results.

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.

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>
This commit is contained in:
Don Skidmore 2009-07-02 12:50:52 +00:00 committed by David S. Miller
parent 19343de279
commit 5da43c1a78

View File

@ -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;
}
}