aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2023-02-09 00:32:54 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2023-02-23 00:29:58 +0000
commite7de5b89b72da29933f0e7f2852b33b1ba0eb442 (patch)
tree5fe9bd91d0d6269ad7f1c60a369c3ad5fbbb9c1f
parent0aacd70843949f793a8cc9cbba76472137644032 (diff)
downloadsrc-e7de5b89b72da29933f0e7f2852b33b1ba0eb442.tar.gz
src-e7de5b89b72da29933f0e7f2852b33b1ba0eb442.zip
e1000: Fix packet loss on 11th gen and later
Ungate DMA clock on TGP and later to avoid packet loss. A similar fix appears in Linux 639e298f432fb058a9496ea16863f53b1ce935fe This may be needed as far back as SPT but no confirmation from intel or other OS yet. Obtained from: OpenBSD (if_em_hw.c 1.116) Sponsored by: BBOX.io (cherry picked from commit 56365902147791994157c3a8f75784dafd46dbd8)
-rw-r--r--sys/dev/e1000/e1000_ich8lan.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c
index 7d079ee5d1b3..9893aa413b2c 100644
--- a/sys/dev/e1000/e1000_ich8lan.c
+++ b/sys/dev/e1000/e1000_ich8lan.c
@@ -5174,6 +5174,13 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
snoop = (u32) ~(PCIE_NO_SNOOP_ALL);
e1000_set_pcie_no_snoop_generic(hw, snoop);
+ /* ungate DMA clock to avoid packet loss */
+ if (mac->type >= e1000_pch_tgp) {
+ uint32_t fflt_dbg = E1000_READ_REG(hw, E1000_FFLT_DBG);
+ fflt_dbg |= (1 << 12);
+ E1000_WRITE_REG(hw, E1000_FFLT_DBG, fflt_dbg);
+ }
+
ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);