🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24590

Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement

#24590
From: Cristian Ciocaltea
Date: Mon, 30 Nov 2026 11:53
40 lines
10603 bytes
On 11/30/26 5:34 AM, Andrew Lunn wrote:
> On Mon, Nov 30, 2026 at 02:55:18AM +0200, Cristian Ciocaltea wrote:
>> The Clause 45 ability registers hold a single bit for 10BASE-T and one
>> for 100BASE-TX, so genphy_c45_pma_read_abilities() derives both the full
>> and half duplex link modes from each of them, even on PHYs that support
>> neither 10BASE-T nor half duplex.
>>
>> Read the 2.5G, 5G and 10G abilities from the Clause 45 registers as
>> before, then take the 10M, 100M and 1G link modes from the Clause 22
>> ADVERTISE and CTRL1000 registers mapped in the AN MMD.  The firmware
>> does not update the C22 BMSR/ESTATUS ability bits, but its default
>> advertisement reflects the modes the PHY actually supports.  If the
>> advertisement reads back empty, keep the Clause 45 derived modes.
> 
> This is funky, i'm not sure this is a safe assumption to make.
> 
> Is it known what this PHY actually supports? 
> 
> I think it would be better to just accept the firmware is broken and
> hard code the 10/100/1G link modes after calling
> genphy_c45_pma_read_abilities().

Yeah, the firmware is definitely broken.  This is what ethtool currently shows
for both PHY generations:

    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
                            10000baseT/Full
                            2500baseT/Full
                            5000baseT/Full

However, my understanding is that Gen1 doesn't actually support 10baseT, only
Gen2 does, while 100baseT/Half is never advertised by the firmware. I can go
with the hard-coded approach, as there doesn't seem to be a better or more
reliable way to get this information from the hardware.

Thanks,
Cristian
Technical Details
Message-ID: <78142251-19b5-49f5-9ca7-038dd3e70650@collabora.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374146-linux-kernel-netdev=dewy.ru
References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-11-1bd2eae6ccbc@collabora.com> <91684d78-c827-42e4-9563-c3ce1dcfe6be@lunn.ch>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374146-linux-kernel-netdev=dewy.ru
From: cristian.ciocaltea@collabora.com (Cristian Ciocaltea)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes
 from C22 advertisement
Date: Mon, 30 Nov 2026 13:53:19 +0200
Organization: Usenet Network
Message-ID: <78142251-19b5-49f5-9ca7-038dd3e70650@collabora.com>
References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com>
 <20261130-as21xxx-fixes-v1-11-1bd2eae6ccbc@collabora.com>
 <91684d78-c827-42e4-9563-c3ce1dcfe6be@lunn.ch>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1417403"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5pFqhNEcNnzejm8cGeaB+ChgyF8= sha256:62aC3wjJyIxXDwXYyRsFSUs0BJs0eUhjFsmxxHShXGk=
	sha1:q3IoT1IT0PK9ZI3ttC8PLIKSApo= sha256:42yTBPPjuqY+VIj5+BPVo1cvLmBlEyibMduj7Ql8lbI=
Content-Language: en-US
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id D8358125FDE; Mon, 30 Nov 2026 14:54:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=collabora.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id tJOH0N6TIPbU;
	Mon, 30 Nov 2026 14:54:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374146-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=collabora.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id D9A9A125FD9; Mon, 30 Nov 2026 14:54:38 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id AA3E12B9C2; Mon, 30 Nov 2026 11:53:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796039603;
	b=rcq40mO0EYLIMeLuymxUhfnXEMUGPeZ6U+Pqsq2RrF+azDb3vnvPPl/3EktdK8+yIZOm
	 50G1XKdzR2ZacIJgmxjbBpXA9AKj3CyZMq/i2iU9MKSHHid/Im9JJdtMa+gROXSLCuWng
	 xNNbsmh3czIXVpv6yn1+sh+flpVaT/a4M1J43GHihIir9m4q4a9t7kayGnp4minCRyscl
	 Epg+UsXR4c6B8MBe9VK47WxYuEp4HPka+lrVKRppNl18R1PybTN9f4yro9OPPSdbhLm6L
	 sEpQ18/1hoknEeA42V+3VOM/7tGhRoQVFdQ1WmrzvdGqSE9HEpQbfaAlVDyTwnRAiXg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796039603;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:
	 Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=DgCO2rf02KlY6brG2KxHtVYxb+cRAQExAUTnzSmVsCs=;
	b=xFjtZciWFhjnJrafIFb0EKsGpUQUbPQxgwyHkhm+lk4lg5VfDERhv4sXRCIPBgsbqiRR
	 5KRtlCG0yy2QfO4+3HWZI2qwYSuA15sBFO4CqvpvPDV14PchQSXutEpzJUIY8fOLuHvDy
	 N6dhk9bFX72M2LTtlcWdte/5Fhz2adpNkMmIWXU7uXikBPPXiV8fpz8tRWdp9OvCky6fb
	 +/qqnn3IMuGyUgqk804nijLgar5S4vitVzXuaTuLBV6ocE1w6n3qfq+OKtZbMSsfHYJIj
	 M+dEcerb3u6Xm376LCigTXcIQ0jNXnV0zA8q+LwYMYC9Aj21YmS8WW+Gdvh1eCz6W2g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=TeZTL+Nx;
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 59D36606C413;
	Mon, 30 Nov 2026 11:53:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=TeZTL+Nx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796039602;
	b=dWzDvMktQPmMAq4ZghStuYrsQ0048R8eIDpUKML375Hznz5nn/0cgPX317SaeuIDz9VE
	 /nFm0a6cSb8Dh19HjSoXi8mbo6tRHjfdLMSNClbjjkwYe7kqtNQFRyjcKKUSj8pcLbv6h
	 +rRTrlyyp4oRiKYvLjSXL4931T7Y64mwro6xxRkUTx//bwP+L4lfBq2oUlgGj/xyHCiJW
	 qsw3FUG+WoAXCQv1Mlpcs5Lc1mHXzSgdD0zYTMNyYhtiBynGAPLgU+0axAUCLDdYKIwvQ
	 D7/8oY8Gc0HhvRgsgc7xlQOYTs+36hgTqqvs/BAfdN+QcNkuJvSv/ktlEgfadsKZlRw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796039602;
	h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version:
	 User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=DgCO2rf02KlY6brG2KxHtVYxb+cRAQExAUTnzSmVsCs=;
	b=wopDOtW8AF1eU460q1lervFyooqzXIINYnKDVxRM4lHHFr47k2ronWuSVH894H5EjqkB
	 iRKXQ2neET+j6dI/I2bxORHfA1ENbVxSQTUu5ag7kVuoBE7KonsFiez4gnKWquszF3k1I
	 Hc0w1QtwyhBmuxTRdt88i//TgYr01nmDS2R9kZuu3RTiLXj1h7Ty3NtfUUWvVB27tYWKd
	 eJNPQZwLGZr43s82r05GqP/UnqXn29lS0k/5x0YAcpXI4/K1k24OyvTHEhVLBKP7xgEwE
	 99B3bkcQRxFsbALfQ001XNvv85oBs+NXsJrAPZlJmIfDYlg/VtkF9Uzd3FZU7vfzTKw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.com;
	dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=TeZTL+Nx;
	arc=none smtp.remote-ip=148.251.105.195
X-Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFE3E60A261A
	for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 11:53:21 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EFE3E60A261A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;
	s=mail; t=1796039600;
	bh=eJV4nF5GOO16Padn6tPcNLIoXUTmc2qycruSAP6STUk=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=TeZTL+Nx83z5WIX1BBOl7gMD4JZU2wgI9wt25zr0fEdP1a+RxdXhLfrALFK/ZV4w/
	 UCl9wOTRUv8gI0NXwJfqHHmgDDrf3bEmMEXADRSky+QT2rHSPRX0UfVtJYERe1Lj/L
	 KHMFB8YE5x3LahhiylZLy5Pk863MxUypwYvxpkNzhs9+H365G8PjvY6HESrdJ91pRP
	 d+Q/7YEnhPbgeYbo0cXsN99e9bIuz2JiTDXQtcAMg/mkgK0+1/Q9wnTC3uvH8ypjqS
	 yIggy7rEThaMphOJYjUugbk6kuehC9XlBe7TzBLWdUUstle5zr26pBfBwq9EspdsC4
	 K2X/rMyyGGeWw==
X-Received: from [100.64.0.241] (unknown [100.64.0.241])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	(Authenticated sender: cristicc)
	by bali.collaboradmins.com (Postfix) with ESMTPSA id C59F117E0390;
	Mon, 30 Nov 2026 12:53:19 +0100 (CET)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: Christian Marangi <ansuelsmth@gmail.com>,
 Heiner Kallweit <hkallweit1@gmail.com>, Russell King
 <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>,
 Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>,
 Paolo Abeni <pabeni@redhat.com>, kernel@collabora.com, netdev@vger.kernel.org
X-In-Reply-To: <91684d78-c827-42e4-9563-c3ce1dcfe6be@lunn.ch>