[v2,21/54] net/e1000/base: fix LTR for i225

Message ID bbaac0d5edc45ac926aadbe029bf46d4fea9e358.1738681726.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series Merge Intel IGC and E1000 drivers, and update E1000 base code |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly Feb. 4, 2025, 3:10 p.m. UTC
From: Sasha Neftin <sasha.neftin@intel.com>

i225 specification recommends minus 1 microsecond from a value
calculated for a LTR. Fix the calculation to match spec.

Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 ++
 1 file changed, 2 insertions(+)
  

Patch

diff --git a/drivers/net/intel/e1000/base/e1000_i225.c b/drivers/net/intel/e1000/base/e1000_i225.c
index 999fa03a3d..0b029c0ac2 100644
--- a/drivers/net/intel/e1000/base/e1000_i225.c
+++ b/drivers/net/intel/e1000/base/e1000_i225.c
@@ -982,7 +982,9 @@  static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 		scale_max = (ltr_max / 1024) < 1024 ? E1000_LTRMAXV_SCALE_1024 :
 			    E1000_LTRMAXV_SCALE_32768;
 		ltr_min /= scale_min == E1000_LTRMINV_SCALE_1024 ? 1024 : 32768;
+		ltr_min -= 1;
 		ltr_max /= scale_max == E1000_LTRMAXV_SCALE_1024 ? 1024 : 32768;
+		ltr_max -= 1;
 
 		/* Only write the LTR thresholds if they differ from before. */
 		ltrv = E1000_READ_REG(hw, E1000_LTRMINV);