> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-boun...@osuosl.org> On Behalf Of Jacob > Keller > Sent: Tuesday, May 21, 2024 3:10 AM > To: Intel Wired LAN <intel-wired-...@lists.osuosl.org> > Cc: Keller, Jacob E <jacob.e.kel...@intel.com>; Kitszel, Przemyslaw > <przemyslaw.kits...@intel.com>; Greenwalt, Paul <paul.greenw...@intel.com> > Subject: [Intel-wired-lan] [PATCH iwl-net] ice: fix reads from NVM Shadow RAM > on E830 and E825-C devices > > The ice driver reads data from the Shadow RAM portion of the NVM during > initialization, including data used to identify the NVM image and device, > such as the ETRACK ID used to populate devlink dev info fw.bundle. > > Currently it is using a fixed offset defined by ICE_CSS_HEADER_LENGTH to > compute the appropriate offset. This worked fine for E810 and E822 devices > which both have CSS header length of 330 words. > > Other devices, including both E825-C and E830 devices have different sizes > for their CSS header. The use of a hard coded value results in the driver > reading from the wrong block in the NVM when attempting to access the Shadow > RAM copy. This results in the driver reporting the fw.bundle as 0x0 in both > the devlink dev info and ethtool -i output. > > The first E830 support was introduced by commit ba20ecb1d1bb ("ice: Hook up > 4 E830 devices by adding their IDs") and the first E825-C support was > introducted by commit f64e18944233 ("ice: introduce new E825C devices > family") > > The NVM actually contains the CSS header length embedded in it. Remove the > hard coded value and replace it with logic to read the length from the NVM > directly. This is more resilient against all existing and future hardware, vs > looking up the expected values from a table. > It ensures the driver will > read from the appropriate place when determining the ETRACK ID value used for > populating the fw.bundle_id and for reporting in ethtool -i. > > The CSS header length for both the active and inactive flash bank is stored > in the ice_bank_info structure to avoid unnecessary duplicate work when > accessing multiple words of the Shadow RAM. Both banks are read in the > unlikely event that the header length is different for the NVM in the > inactive bank, rather than being different only by the overall device family. > > Fixes: ba20ecb1d1bb ("ice: Hook up 4 E830 devices by adding their IDs") > Co-developed-by: Paul Greenwalt <paul.greenw...@intel.com> > Signed-off-by: Paul Greenwalt <paul.greenw...@intel.com> > Signed-off-by: Jacob Keller <jacob.e.kel...@intel.com> > Reviewed-by: Przemek Kitszel <przemyslaw.kits...@intel.com> > --- > drivers/net/ethernet/intel/ice/ice_nvm.c | 88 > ++++++++++++++++++++++++++++++- drivers/net/ethernet/intel/ice/ice_type.h | > 14 +++-- > 2 files changed, 93 insertions(+), 9 deletions(-) >
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pu...@intel.com> (A Contingent worker at Intel)