[v2,22/54] net/e1000/base: fix typo in LTR calculation

Message ID 5c15dc7fa1e6d2e93de91420884dc1af8b1ac535.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: Dima Ruinskiy <dima.ruinskiy@intel.com>

The LTR maximum value was incorrectly written using the scale from the
LTR minimum value. This would cause incorrect values to be sent, in cases
where the initial calculation lead to different min/max scales. Fix the
typo to correctly calculate the LTR maximum value.

Signed-off-by: Dima Ruinskiy <dima.ruinskiy@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/intel/e1000/base/e1000_i225.c b/drivers/net/intel/e1000/base/e1000_i225.c
index 0b029c0ac2..611f3e8408 100644
--- a/drivers/net/intel/e1000/base/e1000_i225.c
+++ b/drivers/net/intel/e1000/base/e1000_i225.c
@@ -997,7 +997,7 @@  static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 		ltrv = E1000_READ_REG(hw, E1000_LTRMAXV);
 		if (ltr_max != (ltrv & E1000_LTRMAXV_LTRV_MASK)) {
 			ltrv = E1000_LTRMAXV_LSNP_REQ | ltr_max |
-			      (scale_min << E1000_LTRMAXV_SCALE_SHIFT);
+			      (scale_max << E1000_LTRMAXV_SCALE_SHIFT);
 			E1000_WRITE_REG(hw, E1000_LTRMAXV, ltrv);
 		}
 	}