aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2026-08-11 16:18:33 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2026-08-11 20:44:58 +0000
commit6058dfa40238e2cd6ac6f2377986fdff99d14686 (patch)
tree71cfdb4731b5065dc04724ecbc4113b86e3b0f3a /sys/dev
parent17d90d5b9350239a87e66a3612cb9b084b2d75e9 (diff)
e1000: Compare decoded PCH LTR latencies
The LTR encoding combines a value and a nonlinear scale, so encoded values cannot be compared directly. Decode both the device latency and the platform maximum before deciding whether to clamp the request. MFC after: 2 weeks
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/e1000/e1000_ich8lan.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c
index 29f5b2ff69bd..e7ff5a581ad1 100644
--- a/sys/dev/e1000/e1000_ich8lan.c
+++ b/sys/dev/e1000/e1000_ich8lan.c
@@ -1218,6 +1218,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
u16 speed, duplex, scale = 0;
u16 max_snoop, max_nosnoop;
u16 max_ltr_enc; /* max LTR latency encoded */
+ u64 max_ltr_ns;
s64 lat_ns;
s64 value;
u32 rxa;
@@ -1266,10 +1267,11 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)
e1000_read_pci_cfg(hw, E1000_PCI_LTR_CAP_LPT, &max_snoop);
e1000_read_pci_cfg(hw, E1000_PCI_LTR_CAP_LPT + 2, &max_nosnoop);
max_ltr_enc = E1000_MAX(max_snoop, max_nosnoop);
+ max_ltr_ns = e1000_ltr2ns(max_ltr_enc);
- if (lat_enc > max_ltr_enc) {
+ if (e1000_ltr2ns(lat_enc) > max_ltr_ns) {
lat_enc = max_ltr_enc;
- lat_ns = e1000_ltr2ns(max_ltr_enc);
+ lat_ns = max_ltr_ns;
}
if (lat_ns) {