Skip to content

Commit 861e808

Browse files
vlifshtsanguy11
authored andcommitted
e1000e: move force SMBUS from enable ulp function to avoid PHY loss issue
Forcing SMBUS inside the ULP enabling flow leads to sporadic PHY loss on some systems. It is suspected to be caused by initiating PHY transactions before the interface settles. Separating this configuration from the ULP enabling flow and moving it to the shutdown function allows enough time for the interface to settle and avoids adding a delay. Fixes: 6607c99 ("e1000e: i219 - fix to enable both ULP and EEE in Sx state") Co-developed-by: Dima Ruinskiy <[email protected]> Signed-off-by: Dima Ruinskiy <[email protected]> Signed-off-by: Vitaly Lifshits <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 6dbdd4d commit 861e808

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,25 +1165,6 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
11651165
if (ret_val)
11661166
goto out;
11671167

1168-
/* Switching PHY interface always returns MDI error
1169-
* so disable retry mechanism to avoid wasting time
1170-
*/
1171-
e1000e_disable_phy_retry(hw);
1172-
1173-
/* Force SMBus mode in PHY */
1174-
ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
1175-
if (ret_val)
1176-
goto release;
1177-
phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
1178-
e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
1179-
1180-
e1000e_enable_phy_retry(hw);
1181-
1182-
/* Force SMBus mode in MAC */
1183-
mac_reg = er32(CTRL_EXT);
1184-
mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
1185-
ew32(CTRL_EXT, mac_reg);
1186-
11871168
/* Si workaround for ULP entry flow on i127/rev6 h/w. Enable
11881169
* LPLU and disable Gig speed when entering ULP
11891170
*/

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6623,6 +6623,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
66236623
struct e1000_hw *hw = &adapter->hw;
66246624
u32 ctrl, ctrl_ext, rctl, status, wufc;
66256625
int retval = 0;
6626+
u16 smb_ctrl;
66266627

66276628
/* Runtime suspend should only enable wakeup for link changes */
66286629
if (runtime)
@@ -6696,6 +6697,23 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
66966697
if (retval)
66976698
return retval;
66986699
}
6700+
6701+
/* Force SMBUS to allow WOL */
6702+
/* Switching PHY interface always returns MDI error
6703+
* so disable retry mechanism to avoid wasting time
6704+
*/
6705+
e1000e_disable_phy_retry(hw);
6706+
6707+
e1e_rphy(hw, CV_SMB_CTRL, &smb_ctrl);
6708+
smb_ctrl |= CV_SMB_CTRL_FORCE_SMBUS;
6709+
e1e_wphy(hw, CV_SMB_CTRL, smb_ctrl);
6710+
6711+
e1000e_enable_phy_retry(hw);
6712+
6713+
/* Force SMBus mode in MAC */
6714+
ctrl_ext = er32(CTRL_EXT);
6715+
ctrl_ext |= E1000_CTRL_EXT_FORCE_SMBUS;
6716+
ew32(CTRL_EXT, ctrl_ext);
66996717
}
67006718

67016719
/* Ensure that the appropriate bits are set in LPI_CTRL

0 commit comments

Comments
 (0)