From 29b00dc3c135a704d3816dcb3de73114cd727fa9 Mon Sep 17 00:00:00 2001 From: Wenzhuo Lu Date: Fri, 5 Jun 2015 13:21:56 +0800 Subject: [PATCH] ixgbe/base: fix lan id before first i2c access Set the lan_id before the first I2C access. The existing call was clearly being done after a previous I2C access in the same function and that can't be right, so call the set_lan_id method earlier. At this point it probably doesn't matter for this QSFP function, but it makes sense to do it consistently anyway. On X550, be sure to set the lan_id before using it to configure the mux control output, else the mux will not be controlled. Signed-off-by: Wenzhuo Lu Acked-by: Helin Zhang --- drivers/net/ixgbe/base/ixgbe_phy.c | 6 +++--- drivers/net/ixgbe/base/ixgbe_x550.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_phy.c b/drivers/net/ixgbe/base/ixgbe_phy.c index e5ededb012..3ba5661a1e 100644 --- a/drivers/net/ixgbe/base/ixgbe_phy.c +++ b/drivers/net/ixgbe/base/ixgbe_phy.c @@ -1692,6 +1692,9 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) goto out; } + /* LAN ID is needed for I2C access */ + hw->mac.ops.set_lan_id(hw); + status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_IDENTIFIER, &identifier); @@ -1706,9 +1709,6 @@ s32 ixgbe_identify_qsfp_module_generic(struct ixgbe_hw *hw) hw->phy.id = identifier; - /* LAN ID is needed for sfp_type determination */ - hw->mac.ops.set_lan_id(hw); - status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_QSFP_10GBE_COMP, &comp_codes_10g); diff --git a/drivers/net/ixgbe/base/ixgbe_x550.c b/drivers/net/ixgbe/base/ixgbe_x550.c index 4608f75b44..93016863c1 100644 --- a/drivers/net/ixgbe/base/ixgbe_x550.c +++ b/drivers/net/ixgbe/base/ixgbe_x550.c @@ -1291,6 +1291,8 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) DEBUGFUNC("ixgbe_init_phy_ops_X550em"); + hw->mac.ops.set_lan_id(hw); + if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; ixgbe_setup_mux_ctl(hw); -- 2.20.1