Commit 7155d051 authored by Don Skidmore's avatar Don Skidmore Committed by Jeff Kirsher

ixgbe: Stop cacheing if the MNG FW enabled

We use to cache whether the MNG FW was enabled, how since this isn't
static we really need to verify with each check.  This patch makes that
change.

CC: Arun Sharma <asharma@fb.com>
Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 65ce9dcd
...@@ -1315,7 +1315,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = { ...@@ -1315,7 +1315,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
.release_swfw_sync = &ixgbe_release_swfw_sync, .release_swfw_sync = &ixgbe_release_swfw_sync,
.get_thermal_sensor_data = NULL, .get_thermal_sensor_data = NULL,
.init_thermal_sensor_thresh = NULL, .init_thermal_sensor_thresh = NULL,
.mng_fw_enabled = NULL,
.prot_autoc_read = &prot_autoc_read_generic, .prot_autoc_read = &prot_autoc_read_generic,
.prot_autoc_write = &prot_autoc_write_generic, .prot_autoc_write = &prot_autoc_write_generic,
}; };
......
...@@ -67,7 +67,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset, ...@@ -67,7 +67,7 @@ static s32 ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw); static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
static bool ixgbe_mng_enabled(struct ixgbe_hw *hw) bool ixgbe_mng_enabled(struct ixgbe_hw *hw)
{ {
u32 fwsm, manc, factps; u32 fwsm, manc, factps;
...@@ -94,7 +94,7 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) ...@@ -94,7 +94,7 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
* and MNG not enabled * and MNG not enabled
*/ */
if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) && if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
!hw->mng_fw_enabled) { !ixgbe_mng_enabled(hw)) {
mac->ops.disable_tx_laser = mac->ops.disable_tx_laser =
&ixgbe_disable_tx_laser_multispeed_fiber; &ixgbe_disable_tx_laser_multispeed_fiber;
mac->ops.enable_tx_laser = mac->ops.enable_tx_laser =
...@@ -1206,7 +1206,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) ...@@ -1206,7 +1206,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
* Likewise if we support WoL we don't want change the * Likewise if we support WoL we don't want change the
* LMS state either. * LMS state either.
*/ */
if ((hw->phy.multispeed_fiber && hw->mng_fw_enabled) || if ((hw->phy.multispeed_fiber && ixgbe_mng_enabled(hw)) ||
hw->wol_enabled) hw->wol_enabled)
hw->mac.orig_autoc = hw->mac.orig_autoc =
(hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) | (hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) |
...@@ -2500,7 +2500,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = { ...@@ -2500,7 +2500,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
.release_swfw_sync = &ixgbe_release_swfw_sync, .release_swfw_sync = &ixgbe_release_swfw_sync,
.get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic, .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic,
.init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic, .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic,
.mng_fw_enabled = &ixgbe_mng_enabled,
.prot_autoc_read = &prot_autoc_read_82599, .prot_autoc_read = &prot_autoc_read_82599,
.prot_autoc_write = &prot_autoc_write_82599, .prot_autoc_write = &prot_autoc_write_82599,
}; };
......
...@@ -111,6 +111,7 @@ s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps); ...@@ -111,6 +111,7 @@ s32 ixgbe_get_device_caps_generic(struct ixgbe_hw *hw, u16 *device_caps);
s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min, s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
u8 build, u8 ver); u8 build, u8 ver);
void ixgbe_clear_tx_pending(struct ixgbe_hw *hw); void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);
bool ixgbe_mng_enabled(struct ixgbe_hw *hw);
void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb, void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb,
u32 headroom, int strategy); u32 headroom, int strategy);
......
...@@ -8038,10 +8038,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8038,10 +8038,6 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
goto err_sw_init; goto err_sw_init;
/* Cache if MNG FW is up so we don't have to read the REG later */
if (hw->mac.ops.mng_fw_enabled)
hw->mng_fw_enabled = hw->mac.ops.mng_fw_enabled(hw);
/* Make it possible the adapter to be woken up via WOL */ /* Make it possible the adapter to be woken up via WOL */
switch (adapter->hw.mac.type) { switch (adapter->hw.mac.type) {
case ixgbe_mac_82599EB: case ixgbe_mac_82599EB:
...@@ -8292,7 +8288,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8292,7 +8288,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ixgbe_dbg_adapter_init(adapter); ixgbe_dbg_adapter_init(adapter);
/* Need link setup for MNG FW, else wait for IXGBE_UP */ /* Need link setup for MNG FW, else wait for IXGBE_UP */
if (hw->mng_fw_enabled && hw->mac.ops.setup_link) if (ixgbe_mng_enabled(hw) && hw->mac.ops.setup_link)
hw->mac.ops.setup_link(hw, hw->mac.ops.setup_link(hw,
IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL, IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL,
true); true);
......
...@@ -2921,7 +2921,6 @@ struct ixgbe_mac_operations { ...@@ -2921,7 +2921,6 @@ struct ixgbe_mac_operations {
s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8); s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
s32 (*get_thermal_sensor_data)(struct ixgbe_hw *); s32 (*get_thermal_sensor_data)(struct ixgbe_hw *);
s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw); s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);
bool (*mng_fw_enabled)(struct ixgbe_hw *hw);
}; };
struct ixgbe_phy_operations { struct ixgbe_phy_operations {
...@@ -3052,7 +3051,6 @@ struct ixgbe_hw { ...@@ -3052,7 +3051,6 @@ struct ixgbe_hw {
bool adapter_stopped; bool adapter_stopped;
bool force_full_reset; bool force_full_reset;
bool allow_unsupported_sfp; bool allow_unsupported_sfp;
bool mng_fw_enabled;
bool wol_enabled; bool wol_enabled;
}; };
......
...@@ -855,7 +855,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = { ...@@ -855,7 +855,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
.enable_rx_buff = &ixgbe_enable_rx_buff_generic, .enable_rx_buff = &ixgbe_enable_rx_buff_generic,
.get_thermal_sensor_data = NULL, .get_thermal_sensor_data = NULL,
.init_thermal_sensor_thresh = NULL, .init_thermal_sensor_thresh = NULL,
.mng_fw_enabled = NULL,
.prot_autoc_read = &prot_autoc_read_generic, .prot_autoc_read = &prot_autoc_read_generic,
.prot_autoc_write = &prot_autoc_write_generic, .prot_autoc_write = &prot_autoc_write_generic,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment