e1000e: Fix packet loss on Tiger Lake and later
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / intel / e1000e / ich8lan.c
index 66d7196..5e4fc9b 100644 (file)
@@ -4813,7 +4813,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 {
        struct e1000_mac_info *mac = &hw->mac;
-       u32 ctrl_ext, txdctl, snoop;
+       u32 ctrl_ext, txdctl, snoop, fflt_dbg;
        s32 ret_val;
        u16 i;
 
@@ -4872,6 +4872,15 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
                snoop = (u32)~(PCIE_NO_SNOOP_ALL);
        e1000e_set_pcie_no_snoop(hw, snoop);
 
+       /* Enable workaround for packet loss issue on TGP PCH
+        * Do not gate DMA clock from the modPHY block
+        */
+       if (mac->type >= e1000_pch_tgp) {
+               fflt_dbg = er32(FFLT_DBG);
+               fflt_dbg |= E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK;
+               ew32(FFLT_DBG, fflt_dbg);
+       }
+
        ctrl_ext = er32(CTRL_EXT);
        ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
        ew32(CTRL_EXT, ctrl_ext);