On Mon, Nov 30, 2026 at 02:21:12PM +0200, Cristian Ciocaltea wrote:
> On 11/30/26 5:50 AM, Andrew Lunn wrote:
> > On Mon, Nov 30, 2026 at 02:55:20AM +0200, Cristian Ciocaltea wrote:
> >> With autoneg enabled, as21xxx_read_status() derives the result purely in > >> software via phy_resolve_aneg_linkmode(). That does not work reliably > >> here: the advertisement is driven by the firmware over IPC, which > >> ignores the Clause 45 AN registers phylib writes except for the maximum > >> speed, and arbitrary subsets of speeds are not supported.
> > > > So the firmware is totally FUBAR? > > > > So autoneg does not work, other than for a single link mode? This > > suggests you are setting phydev->supported wrongly. It should have a > > single link mode in it, the top speed the PHY supports. > > > > phylib should then do the correct thing, it will only let the user > > select that one link mode for advertisement.
> > As previously discussed, the root cause of all this unexpected behavior is the > firmware limitation: it cannot handle arbitrary subsets of speeds and always > advertises the full range, from the minimum supported speed up to the top one > (the only limit that can be enforced). > > aeon$ ethtool -s eth1 autoneg on advertise 0x800000000000 # 2.5G > > peer$ ethtool enp0s13f0u1 > Link partner advertised link modes: 100baseT/Full > 1000baseT/Full > 2500baseT/Full
What happens if you return -EOPNOTSUPP here? Does it make it back to userspace? I don't think it is guaranteed to. This is probably the first PHY which is broken like this, all other vendors are capable of reading 802.3. So we don't have support in phylib for this sort of brokenness. Maybe add a new op to struct phy_device: /** * @validate_aneg: Validate that the PHY can actually advertise this valid * combination of link modes. * Return 0 if it can, -EOPNOTSUPP if the PHY is broken and cannot. */ int (validate_aneg)(struct phy_device *phydev, unsigned long *advertisement); Call it in phy_ethtool_ksettings_set() when not NULL. Andrew