On Tue, Jun 24, 2025 at 09:14:40PM +0200, Jacek Kowalski wrote: > As described by Vitaly Lifshits: > > > Starting from Tiger Lake, LAN NVM is locked for writes by SW, so the > > driver cannot perform checksum validation and correction. This means > > that all NVM images must leave the factory with correct checksum and > > checksum valid bit set. > > Unfortunately some systems have left the factory with an empty checksum. > NVM is not modifiable on this platform, hence ignore checksum 0xFFFF on > Tiger Lake systems to work around this.
I think that you need to update the patch description. As of v3 it's the last word of the checksum that is being checked, not the entire checksum. > > Signed-off-by: Jacek Kowalski <[email protected]> > Tested-by: Vlad URSU <[email protected]> > Fixes: 4051f68318ca9 ("e1000e: Do not take care about recovery NVM checksum") > Cc: [email protected] > --- > v2: new check to fix yet another checksum issue > v2 -> v3: fix variable bein compared, drop u16 cast > drivers/net/ethernet/intel/e1000e/defines.h | 3 +++ > drivers/net/ethernet/intel/e1000e/nvm.c | 5 +++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/net/ethernet/intel/e1000e/defines.h > b/drivers/net/ethernet/intel/e1000e/defines.h > index 8294a7c4f122..2dcf46080533 100644 > --- a/drivers/net/ethernet/intel/e1000e/defines.h > +++ b/drivers/net/ethernet/intel/e1000e/defines.h > @@ -638,6 +638,9 @@ > /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */ > #define NVM_SUM 0xBABA > > +/* Factory-default checksum value */ > +#define NVM_CHECKSUM_FACTORY_DEFAULT 0xFFFF Perhaps it is too long, but I liked Vlad's suggestion of naming this NVM_CHECKSUM_WORD_FACTORY_DEFAULT. > + > /* PBA (printed board assembly) number words */ > #define NVM_PBA_OFFSET_0 8 > #define NVM_PBA_OFFSET_1 9 > diff --git a/drivers/net/ethernet/intel/e1000e/nvm.c > b/drivers/net/ethernet/intel/e1000e/nvm.c > index e609f4df86f4..56f2434bd00a 100644 > --- a/drivers/net/ethernet/intel/e1000e/nvm.c > +++ b/drivers/net/ethernet/intel/e1000e/nvm.c > @@ -558,6 +558,11 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw > *hw) > checksum += nvm_data; > } > > + if (hw->mac.type == e1000_pch_tgp && nvm_data == > NVM_CHECKSUM_FACTORY_DEFAULT) { Please wrap the line above so it is 80 columns wide or less. if (hw->mac.type == e1000_pch_tgp && nvm_data == NVM_CHECKSUM_FACTORY_DEFAULT) { > + e_dbg("Factory-default NVM Checksum on TGP platform - > ignoring\n"); > + return 0; > + } > + > if (checksum != (u16)NVM_SUM) { > e_dbg("NVM Checksum Invalid\n"); > return -E1000_ERR_NVM; -- pw-bot: changes-requested
