On Fri, Mar 20, 2026 at 06:14:54AM +0100, Aleksandr Loktionov wrote: > Three related bugs around FW version reporting after EMPR reset on E610: > > 1. ixgbe_refresh_fw_version() silently discarded the error return from > ixgbe_get_flash_data(), so a failed NVM re-read left adapter->eeprom_id > with whatever stale data it held before the reset. Propagate the error > and set eeprom_id to "unknown" on failure so that ethtool -i and > devlink dev info never show a version that no longer reflects reality. > > 2. ixgbe_devlink_reload_empr_finish() returned 0 without ever refreshing > the FW version after the EMPR completed. Add the refresh call, but > treat it as best-effort: a failure to re-read flash does not mean the > EMPR itself failed. Log a netdev_warn() and return 0 so devlink > reports the correct reload outcome. > > 3. ixgbe_reinit_locked() never refreshed the FW version for E610. > Because E610 has no FW event that notifies peer PFs when an EMPR > triggered by another PF's devlink reload completes, any PF that > subsequently goes through reinit would keep stale data in hw->flash > and adapter->eeprom_id. Add the same best-effort refresh here, > gated on ixgbe_mac_e610, with a netdev_warn() on failure. > > Signed-off-by: Aleksandr Loktionov <[email protected]>
Reviewed-by: Simon Horman <[email protected]> ... > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > index 56aabaa..40d593b 100644 > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c > @@ -1155,12 +1155,30 @@ static int ixgbe_set_eeprom(struct net_device *netdev, > return ret_val; > } > > -void ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter) > +/** > + * ixgbe_refresh_fw_version - re-read flash data and update eeprom_id cache > + * @adapter: board private structure > + * > + * Re-reads the NVM/flash and refreshes the cached adapter->eeprom_id string. > + * On failure the cache is set to "unknown" so that ethtool -i never shows a > + * stale version string after a failed reset. > + * > + * Return: 0 on success, negative error code on failure. > + */ > +int ixgbe_refresh_fw_version(struct ixgbe_adapter *adapter) > { > struct ixgbe_hw *hw = &adapter->hw; > + int err; > + > + err = ixgbe_get_flash_data(hw); > + if (err) { > + strscpy(adapter->eeprom_id, "unknown", > + sizeof(adapter->eeprom_id)); nit: I think you can omit the size argument to strscpy because eeprom_id is an array. > + return err; > + } > > - ixgbe_get_flash_data(hw); > ixgbe_set_fw_version_e610(adapter); > + return 0; > } > > static void ixgbe_get_drvinfo(struct net_device *netdev, ...
