Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

e1000e: make lost bits explicit

For more than 15 years this code has passed in a request for a page and
masked off that page when read/writing. This code has been here forever,
but FIELD_PREP finds the bug when converted to use it. Change the code
to do exactly the same thing but allow the conversion to FIELD_PREP in a
later patch. To make it clear what we lost when making this change I
left a comment, but there is no point to change the code to generate a
correct sequence at this point.

This is not a Fixes tagged patch on purpose because it doesn't change
the binary output.

Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Jesse Brandeburg and committed by
Tony Nguyen
236f31bb 610a689d

+7 -6
+7 -6
drivers/net/ethernet/intel/e1000e/80003es2lan.c
··· 1035 1035 * iteration and increase the max iterations when 1036 1036 * polling the phy; this fixes erroneous timeouts at 10Mbps. 1037 1037 */ 1038 - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4), 1039 - 0xFFFF); 1038 + /* these next three accesses were always meant to use page 0x34 using 1039 + * GG82563_REG(0x34, N) but never did, so we've just corrected the call 1040 + * to not drop bits 1041 + */ 1042 + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, 4, 0xFFFF); 1040 1043 if (ret_val) 1041 1044 return ret_val; 1042 - ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), 1043 - &reg_data); 1045 + ret_val = e1000_read_kmrn_reg_80003es2lan(hw, 9, &reg_data); 1044 1046 if (ret_val) 1045 1047 return ret_val; 1046 1048 reg_data |= 0x3F; 1047 - ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9), 1048 - reg_data); 1049 + ret_val = e1000_write_kmrn_reg_80003es2lan(hw, 9, reg_data); 1049 1050 if (ret_val) 1050 1051 return ret_val; 1051 1052 ret_val =