From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796047296; b=moCp3+Vo7iVosw2nGZQut6kU/xZdKm9mhZPYLAF7okpcZSkpCZWqUws3J7ycSvUJeG9c aKr8XUrxz3Y78I31J2Es7xDNT9hG+ZO3tYsRwohg0ZlrTvKdSDQhCjij+lmwMDI9i+Tq3 18f90oQDojiDFR7euq4adh7JfqUxm8IYJtt+jcCkCEEu3wDiWckP5OGZ+TUzjGQ/mceyx ZpI+aQWGQaPRwiJKoLgSz1wY4QLL+Vq7ZdRgu8HXj7mJWnOekxMec5+VH5g6SuIkFiNAs F1rUS5Llq5FhuV7gMfWLRvHdM8NP8a3LhbCxyIVdm4ul6GYkzsu1vgcSuRTCHnU3kXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796047296; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=pnDPlCAhNixQh+7X5IH9wP3FVxOAUFQuoV9NyPWvnFY=; b=PJtJLdbl+PGQmBMg6RtropRzrwBPHIZQsNmUmogftQ4Oy00M1lSu4zTp7sDrr3rzqwwn Xnm01fP+Bq4qYa9zSa+cLJmkcOtamtgVoQqsri7HaIUcqcZrLinTTdtgNxnk/5k2PEj3N NQpM2By+7mJHMvz3Iz9Q4MCKQItABiEhk0O2y2+OHAKAALna3W+rnvwDyxR8XykcXUDIp C9tMsygIhoyopdehZseULUzVqXcYxz6M5cf9TDSFGsqBy5mYKNC0cnxLWrq22VbcXZT5A zWW5xs4F9pvBQAkv/Wj5+8IPNZ4Etk9+3/nRMYJWecJ0LumcS+lcNJJUm8mf+V+DUcg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=qcG4nWQj; arc=none smtp.remote-ip=156.67.10.101 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2929B606A327 for ; Mon, 30 Nov 2026 14:01:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2929B606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=qcG4nWQj DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=pnDPlCAhNixQh+7X5IH9wP3FVxOAUFQuoV9NyPWvnFY=; b=qcG4nWQjRu58ST19K+8meV3Q0h 4sgildWGVizW77HciR3E/BS5knwQbgWpMyrwC3JZCwdKT6TNijLwcvduuJz1JOU/uVDTLf9QRnMu1 p3UmgbOY2ROmb74sqbLcGfXBeR7MAulw1/NHDeo4bxxNNmL5HfYHdU4TIdqq6ao8j/Lo=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1xY1wY-002Nih-Rp; Mon, 30 Nov 2026 15:01:22 +0100 Date: Mon, 30 Nov 2026 15:01:22 +0100 From: Andrew Lunn To: Cristian Ciocaltea Cc: Christian Marangi , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kernel@collabora.com, netdev@vger.kernel.org Subject: Re: [PATCH net 13/14] net: phy: as21xxx: Fix speed and duplex reporting Message-ID: <7ce66121-c353-4723-beb4-bb9234ff2671@lunn.ch> References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-13-1bd2eae6ccbc@collabora.com> <285d83ae-7c91-44c4-a37c-7c4201c11211@lunn.ch> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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