e1000e: fix ethtool offline register test for I217
The SHRAH[9] register on I217 has a different R/W bit-mask than RAR and SHRAL/H registers. Set R/W bit-mask appropriately for SHRAH[9] when testing the R/W ability of the register. Also, fix the error message log format so that it does not provide misleading information (i.e. the logged register address could be incorrect). Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
031554eab0
commit
a8fc18910b
|
@ -760,8 +760,9 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
|
||||||
(test[pat] & write));
|
(test[pat] & write));
|
||||||
val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset);
|
val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset);
|
||||||
if (val != (test[pat] & write & mask)) {
|
if (val != (test[pat] & write & mask)) {
|
||||||
e_err("pattern test reg %04X failed: got 0x%08X expected 0x%08X\n",
|
e_err("pattern test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n",
|
||||||
reg + offset, val, (test[pat] & write & mask));
|
reg + (offset << 2), val,
|
||||||
|
(test[pat] & write & mask));
|
||||||
*data = reg;
|
*data = reg;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -776,7 +777,7 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
|
||||||
__ew32(&adapter->hw, reg, write & mask);
|
__ew32(&adapter->hw, reg, write & mask);
|
||||||
val = __er32(&adapter->hw, reg);
|
val = __er32(&adapter->hw, reg);
|
||||||
if ((write & mask) != (val & mask)) {
|
if ((write & mask) != (val & mask)) {
|
||||||
e_err("set/check reg %04X test failed: got 0x%08X expected 0x%08X\n",
|
e_err("set/check test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n",
|
||||||
reg, (val & mask), (write & mask));
|
reg, (val & mask), (write & mask));
|
||||||
*data = reg;
|
*data = reg;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -884,12 +885,20 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
|
||||||
E1000_FWSM_WLOCK_MAC_SHIFT;
|
E1000_FWSM_WLOCK_MAC_SHIFT;
|
||||||
|
|
||||||
for (i = 0; i < mac->rar_entry_count; i++) {
|
for (i = 0; i < mac->rar_entry_count; i++) {
|
||||||
/* Cannot test write-protected SHRAL[n] registers */
|
if (mac->type == e1000_pch_lpt) {
|
||||||
if ((wlock_mac == 1) || (wlock_mac && (i > wlock_mac)))
|
/* Cannot test write-protected SHRAL[n] registers */
|
||||||
continue;
|
if ((wlock_mac == 1) || (wlock_mac && (i > wlock_mac)))
|
||||||
|
continue;
|
||||||
|
|
||||||
REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1),
|
/* SHRAH[9] different than the others */
|
||||||
mask, 0xFFFFFFFF);
|
if (i == 10)
|
||||||
|
mask |= (1 << 30);
|
||||||
|
else
|
||||||
|
mask &= ~(1 << 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,
|
||||||
|
0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < mac->mta_reg_count; i++)
|
for (i = 0; i < mac->mta_reg_count; i++)
|
||||||
|
|
Loading…
Reference in New Issue