Skip to contentSkip to conversation

igc: Fix typo in i225 LTR functions

PATCH New Sasha Neftin 2 participants 2 messages Nov 2, 2021 – Nov 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Fix typo in i225 LTR functions

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.

---
 drivers/net/ethernet/intel/igc/igc_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_i225.c +1 -1
index b2ef9fde97b3..b6807e16eea9 100644
@@ -636,7 +636,7 @@ s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
 		ltrv = rd32(IGC_LTRMAXV);
 		if (ltr_max != (ltrv & IGC_LTRMAXV_LTRV_MASK)) {
 			ltrv = IGC_LTRMAXV_LSNP_REQ | ltr_max |
-			       (scale_min << IGC_LTRMAXV_SCALE_SHIFT);
+			       (scale_max << IGC_LTRMAXV_SCALE_SHIFT);
 			wr32(IGC_LTRMAXV, ltrv);
 		}
 	}
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 igc: Fix typo in i225 LTR functions

Quoted 16 lines · Sasha Neftin

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.

---
  drivers/net/ethernet/intel/igc/igc_i225.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_i225.c +0 -0
index b2ef9fde97b3..b6807e16eea9 100644

drivers/net/ethernet/intel/igc/igc_i225.c s32 igc_set_ltr_i225(struct igc_hw *hw, bool link) · line 642

Quoted 8 lines
drivers/net/ethernet/intel/igc/igc_i225.c +1 -1
@@ -636,7 +636,7 @@ s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
  		ltrv = rd32(IGC_LTRMAXV);
  		if (ltr_max != (ltrv & IGC_LTRMAXV_LTRV_MASK)) {
  			ltrv = IGC_LTRMAXV_LSNP_REQ | ltr_max |
-			       (scale_min << IGC_LTRMAXV_SCALE_SHIFT);
+			       (scale_max << IGC_LTRMAXV_SCALE_SHIFT);
  			wr32(IGC_LTRMAXV, ltrv);
  		}
  	}