Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] Series ordering creates a bisect window, and the commit message gives no context for it. - [Low] igb_get_module_eeprom() (drivers/net/ethernet/intel/igb/igb_ethtool.c) now does one I2CCMD… -- igb: read SFP module EEPROM through igb_read_sfp_data_byte This patch moves igb_get_module_info() and igb_get_module_eeprom() off igb_read_phy_reg_i2c(), which addresses the external PHY register space. They now use igb_read_sfp_data_byte(), which addresses the SFP module EEPROM. The module EEPROM is read one byte at a time through I2CCMD.
> igb_get_module_info() and igb_get_module_eeprom() use > igb_read_phy_reg_i2c(), which accesses the external PHY register space. > On designs with an external SGMII PHY this returns PHY register contents > instead of the SFP module EEPROM requested by ethtool -m.
[Severity: Low] Can this problem be reached before the previous patch in this series, "igb: detect M88E1112 100BASE-FX SGMII mode"? Before that patch, igb_init_phy_params_82575() returned early for any non-copper media. So phy->addr was never pointed at an external PHY while media_type was serdes: drivers/net/ethernet/intel/igb/e1000_82575.c:igb_init_phy_params_82575() { ... if (hw->phy.media_type != e1000_media_type_copper) { phy->type = e1000_phy_none; goto out; } ... } The previous patch adds a 100BASE-FX branch. It switches to serdes after igb_get_phy_id_82575() has already set phy->addr to the M88E1112 address: } else if (data == E1000_M88E1112_100BASE_FX) { ... hw->phy.media_type = e1000_media_type_internal_serdes; igb_get_module_info() and igb_get_module_eeprom() return -EOPNOTSUPP for copper and unknown media. So these external SGMII PHY designs seem to reach the old igb_read_phy_reg_i2c() path only after that patch is applied. Consider an M88E1112 strapped for 100BASE-FX at that intermediate commit. ethtool -m would report M88E1112 registers as module EEPROM data. It would also choose SFF-8079 or SFF-8472 based on PHY registers 0x5C/0x5E. Could this patch come before the 100BASE-FX detection patch? Could the commit message also say which change makes this path reachable? One case is unconfirmed. After a MAS media swap, get_invariants runs again and igb_init_phy_params_82575() returns early, which might leave a stale phy->addr. If that path can reach ethtool -m, the problem is older than this series, and a Fixes: tag for stable may be appropriate.
> diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c > index ccc7302dc7bdb..12d449bb062ee 100644 > --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c > +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
[ ... ]
> @@ -3250,36 +3254,17 @@ static int igb_get_module_eeprom(struct net_device *netdev, > struct igb_adapter *adapter = netdev_priv(netdev); > struct e1000_hw *hw = &adapter->hw; > u32 status = 0; > - u16 *dataword; > - u16 first_word, last_word; > int i = 0; > > if (ee->len == 0) > return -EINVAL; > > - first_word = ee->offset >> 1; > - last_word = (ee->offset + ee->len - 1) >> 1; > - > - dataword = kmalloc_objs(u16, last_word - first_word + 1); > - if (!dataword) > - return -ENOMEM; > - > - /* Read EEPROM block, SFF-8079/SFF-8472, word at a time */ > - for (i = 0; i < last_word - first_word + 1; i++) { > - status = igb_read_phy_reg_i2c(hw, (first_word + i) * 2, > - &dataword[i]); > - if (status) { > - /* Error occurred while reading module */ > - kfree(dataword); > + for (i = 0; i < ee->len; i++) { > + status = igb_read_sfp_data_byte(hw, ee->offset + i, &data[i]);
[Severity: Low] Does this double the number of busy-waited I2CCMD transactions in igb_get_module_eeprom()? For a full dump with ee->len = ETH_MODULE_SFF_8472_LEN (512), this loop issues 512 I2CCMD reads. The old word loop issued 256. Each read polls in igb_read_sfp_data_byte(): for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) { udelay(50); data_local = rd32(E1000_I2CCMD); if (data_local & E1000_I2CCMD_READY) break; } This ethtool op runs with RTNL held. Each I2CCMD read returns two bytes. The old code used both, one from bits 7:0 and one from bits 15:8. igb_read_sfp_data_byte() keeps only bits 7:0 and drops the other byte. Could the module EEPROM still be read a word at a time from the SFP address space? That would avoid the extra busy-wait time for ethtool -m.
-- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/2026…%40intel.com