e1000e: fix overrun of PHY RAR array
When copying the MAC RAR registers to PHY there is an error in the calculation of the rar_entry_count, which causes a write of unknown/ undefined register space in the MAC to unknown/undefined register space in the PHY. This patch fixes the overrun with writing to the PHY RAR and also fixes the ethtool offline register tests so that the correctly addressed registers have the appropriate bitmasks for R/W and RO bits for affected parts. Shawn Rader gets credit for finding and fixing the register overrun. Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com> CC: Shawn Rader <shawn.t.rader@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:

committed by
Jeff Kirsher

parent
138953bb6a
commit
c3a0dce35a
@@ -922,6 +922,14 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
|
||||
else
|
||||
mask &= ~(1 << 30);
|
||||
}
|
||||
if (mac->type == e1000_pch2lan) {
|
||||
/* SHRAH[0,1,2] different than previous */
|
||||
if (i == 7)
|
||||
mask &= 0xFFF4FFFF;
|
||||
/* SHRAH[3] different than SHRAH[0,1,2] */
|
||||
if (i == 10)
|
||||
mask |= (1 << 30);
|
||||
}
|
||||
|
||||
REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,
|
||||
0xFFFFFFFF);
|
||||
|
Reference in New Issue
Block a user