Commit 90b82984 authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

e1000e: update workaround for 82579 intermittently disabled during S0->Sx

The workaround which toggles the LANPHYPC (LAN PHY Power Control) value bit
to force the MAC-Phy interconnect into PCIe mode from SMBus mode during
driver load and resume should always be done except if PHY resets are
blocked by the Manageability Engine (ME).  Previously, the toggle was done
only if PHY resets are blocked and the ME was disabled.

The rest of the patch is just indentation changes as a consequence of the
updated workaround.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 79d4e908
...@@ -306,7 +306,6 @@ static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw) ...@@ -306,7 +306,6 @@ static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw)
static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
{ {
struct e1000_phy_info *phy = &hw->phy; struct e1000_phy_info *phy = &hw->phy;
u32 fwsm;
s32 ret_val = 0; s32 ret_val = 0;
phy->addr = 1; phy->addr = 1;
...@@ -325,14 +324,14 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) ...@@ -325,14 +324,14 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
phy->ops.power_down = e1000_power_down_phy_copper_ich8lan; phy->ops.power_down = e1000_power_down_phy_copper_ich8lan;
phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
if (!e1000_check_reset_block(hw)) {
u32 fwsm = er32(FWSM);
/* /*
* The MAC-PHY interconnect may still be in SMBus mode * The MAC-PHY interconnect may still be in SMBus mode after
* after Sx->S0. If the manageability engine (ME) is * Sx->S0. If resetting the PHY is not blocked, toggle the
* disabled, then toggle the LANPHYPC Value bit to force * LANPHYPC Value bit to force the interconnect to PCIe mode.
* the interconnect to PCIe mode.
*/ */
fwsm = er32(FWSM);
if (!(fwsm & E1000_ICH_FWSM_FW_VALID) && !e1000_check_reset_block(hw)) {
e1000_toggle_lanphypc_value_ich8lan(hw); e1000_toggle_lanphypc_value_ich8lan(hw);
msleep(50); msleep(50);
...@@ -340,15 +339,15 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) ...@@ -340,15 +339,15 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
* Gate automatic PHY configuration by hardware on * Gate automatic PHY configuration by hardware on
* non-managed 82579 * non-managed 82579
*/ */
if (hw->mac.type == e1000_pch2lan) if ((hw->mac.type == e1000_pch2lan) &&
!(fwsm & E1000_ICH_FWSM_FW_VALID))
e1000_gate_hw_phy_config_ich8lan(hw, true); e1000_gate_hw_phy_config_ich8lan(hw, true);
}
/* /*
* Reset the PHY before any access to it. Doing so, ensures that * Reset the PHY before any access to it. Doing so, ensures
* the PHY is in a known good state before we read/write PHY registers. * that the PHY is in a known good state before we read/write
* The generic reset is sufficient here, because we haven't determined * PHY registers. The generic reset is sufficient here,
* the PHY type yet. * because we haven't determined the PHY type yet.
*/ */
ret_val = e1000e_phy_hw_reset_generic(hw); ret_val = e1000e_phy_hw_reset_generic(hw);
if (ret_val) if (ret_val)
...@@ -360,6 +359,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) ...@@ -360,6 +359,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
usleep_range(10000, 20000); usleep_range(10000, 20000);
e1000_gate_hw_phy_config_ich8lan(hw, false); e1000_gate_hw_phy_config_ich8lan(hw, false);
} }
}
phy->id = e1000_phy_unknown; phy->id = e1000_phy_unknown;
switch (hw->mac.type) { switch (hw->mac.type) {
...@@ -3736,16 +3736,12 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) ...@@ -3736,16 +3736,12 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw)
**/ **/
void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
{ {
u32 fwsm;
if (hw->mac.type != e1000_pch2lan)
return;
fwsm = er32(FWSM);
if (!(fwsm & E1000_ICH_FWSM_FW_VALID) || !e1000_check_reset_block(hw)) {
u16 phy_id1, phy_id2; u16 phy_id1, phy_id2;
s32 ret_val; s32 ret_val;
if ((hw->mac.type != e1000_pch2lan) || e1000_check_reset_block(hw))
return;
ret_val = hw->phy.ops.acquire(hw); ret_val = hw->phy.ops.acquire(hw);
if (ret_val) { if (ret_val) {
e_dbg("Failed to acquire PHY semaphore in resume\n"); e_dbg("Failed to acquire PHY semaphore in resume\n");
...@@ -3771,7 +3767,6 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) ...@@ -3771,7 +3767,6 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw)
e1000_phy_hw_reset(hw); e1000_phy_hw_reset(hw);
msleep(50); msleep(50);
return; return;
}
release: release:
hw->phy.ops.release(hw); hw->phy.ops.release(hw);
......
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