From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195 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== 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== 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 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 ; Mon, 30 Nov 2026 11:53:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EFE3E60A261A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=TeZTL+Nx 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== 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) Message-ID: <78142251-19b5-49f5-9ca7-038dd3e70650@collabora.com> Date: Mon, 30 Nov 2026 13:53:19 +0200 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net 11/14] net: phy: as21xxx: Read 10/100/1000 link modes from C22 advertisement To: Andrew Lunn Cc: Christian Marangi , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , kernel@collabora.com, netdev@vger.kernel.org References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-11-1bd2eae6ccbc@collabora.com> <91684d78-c827-42e4-9563-c3ce1dcfe6be@lunn.ch> Content-Language: en-US From: Cristian Ciocaltea In-Reply-To: <91684d78-c827-42e4-9563-c3ce1dcfe6be@lunn.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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