e1000e: add workaround for possible stalled packet
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Mon, 8 Jul 2019 04:55:45 +0000 (12:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 10:30:27 +0000 (12:30 +0200)
[ Upstream commit e5e9a2ecfe780975820e157b922edee715710b66 ]

This works around a possible stalled packet issue, which may occur due to
clock recovery from the PCH being too slow, when the LAN is transitioning
from K1 at 1G link speed.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204057

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/e1000e/ich8lan.c
drivers/net/ethernet/intel/e1000e/ich8lan.h

index dc7d671b903c570e968e4bcdf3fb056351bcd731..625008e8cb0dfaf488e06a1221d0d7a0b8367369 100644 (file)
@@ -1447,6 +1447,16 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw)
                        else
                                phy_reg |= 0xFA;
                        e1e_wphy_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg);
+
+                       if (speed == SPEED_1000) {
+                               hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL,
+                                                           &phy_reg);
+
+                               phy_reg |= HV_PM_CTRL_K1_CLK_REQ;
+
+                               hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL,
+                                                            phy_reg);
+                       }
                }
                hw->phy.ops.release(hw);
 
index 67163ca898ba2abca4e4e66eecdf76a5f5c3984c..6374c8fc76a8d4e673a8e974e556cb439df4ee08 100644 (file)
 
 /* PHY Power Management Control */
 #define HV_PM_CTRL             PHY_REG(770, 17)
-#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100
+#define HV_PM_CTRL_K1_CLK_REQ          0x200
 #define HV_PM_CTRL_K1_ENABLE           0x4000
 
 #define I217_PLL_CLOCK_GATE_REG        PHY_REG(772, 28)