Re: [PATCH net-next v4 3/4] net: phy: realtek: add support for RTL8261C_CG

From: Maxime Chevallier

Date: Wed Jun 10 2026 - 12:40:40 EST


Hi,

On 6/9/26 04:07, javen wrote:
> From: Javen Xu <javen_xu@xxxxxxxxxxxxxx>
>
> This patch adds support for Realtek phy chip RTL8261C_CG. Its PHY ID is
> 0x001cc898.
>
> Signed-off-by: Javen Xu <javen_xu@xxxxxxxxxxxxxx>

[...]

> +static int rtl8261x_config_aneg(struct phy_device *phydev)
> +{
> + bool changed = false;
> + u16 adv_1g = 0;
> + int ret;
> +
> + if (phydev->autoneg == AUTONEG_DISABLE)
> + return genphy_c45_pma_setup_forced(phydev);

This condition above is already done when calling genphy_c45_config_aneg,
is it really necessary to put it there ?

> +
> + ret = genphy_c45_an_setup_master_slave(phydev);
> + if (ret < 0)
> + return ret;
> + if (ret > 0)
> + changed = true;

I'm wondering if this call to genphy_c45_an_setup_master_slave() may actually
be integrated directly into genphy_c45_config_aneg(), as we do for C22.

It _may_ break some C45 phys that would rely on default values though, but this
should be more correct ?

Maxime