Re: [PATCH net-next v1 1/2] net: phy: realtek: add support for RTL8261

From: Javen

Date: Tue Jun 02 2026 - 22:35:18 EST


Hi, Nicolai

>> +/* Concatenated 4-bit speed code values (SPD_H << 2 | SPD_L) */
>> +#define RTL8261X_SPEED_CODE_500M 0x3 /* H=0, L=3 */
>> +#define RTL8261X_SPEED_CODE_1000M 0x7 /* H=1, L=3 */
>> +#define RTL8261X_SPEED_CODE_2500M 0x8 /* H=2, L=0 */
>> +#define RTL8261X_SPEED_CODE_5000M 0x9 /* H=2, L=1 */
>> +#define RTL8261X_SPEED_500 500
>
> 500 MBit/s isnt a standard rate which also isnt represented in ethtool.
> Is this just for documentation or intended to be used? If yes, how?

Giga-lite (500M) is a Realtek-proprietary speed: when two Realtek PHYs supporting Giga-lite are connected and the higher speed is disabled or unstable, auto-negotiation may fall back to 500M. Since ethtool has no SPEED_500 definition, the driver reports SPEED_UNKNOWN for this case. So we add this.

>> +
>> +static int rtl8261x_get_features(struct phy_device *phydev)
>> +{
>> + int ret;
>> +
>> + ret = genphy_c45_pma_read_abilities(phydev);
>> + if (ret)
>> + return ret;
>> + /*
>> + * Supplement Multi-Gig speeds that may not be automatically detected
>> + * RTL8261X supports 2.5G/5G in addition to standard 10G
>> + */
>> + linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
>> + phydev->supported);
>> + linkmode_set_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
>> + phydev->supported);
>
>Feature bits for 2.5 and 5 GBit/s are set unconditionally - even for the
>generic variant.
>Do all variants have these capabilities? If not better add check for at
l>east the generic one.

Thank you for pointing this out.
We can confirm that RTL8261C and RTL8261D support 2.5G and 5G.

For this patch only support for RTL8261C, I will remove the code associated with RTL8261D. And other suggestions are all accepted.
Thanks for your time.

BRs,
Javen