Re: [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path

Nicolai Buchwitz <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On 6.8.2026 15:47, Oleksij Rempel wrote:
> In rtlgen_write_mmd(), the MDIO_AN_EEE_ADV case swaps the arguments to
> rtlgen_write_vend2(): it passes the MMD register number as the OCP 
> address
> and the OCP address constant as the value. The caller's value is 
> discarded
> and the write lands on the wrong register, so the EEE advertisement 
> cannot
> be configured on the affected PHYs.
> 
> Mirror rtlgen_read_mmd() and write the value to RTL_MDIO_AN_EEE_ADV.
> 
> Fixes: da681ed73fb9 ("net: phy: realtek: improve mmd register access 
> for internal PHY's")
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
>  drivers/net/phy/realtek/realtek_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/realtek/realtek_main.c 
> b/drivers/net/phy/realtek/realtek_main.c
> index a0a79192384e..177b62a7b2d1 100644
> --- a/drivers/net/phy/realtek/realtek_main.c
> +++ b/drivers/net/phy/realtek/realtek_main.c
> @@ -1768,7 +1768,7 @@ static int rtlgen_write_mmd(struct phy_device 
> *phydev, int devnum, u16 regnum,
>  	if (devnum == MDIO_MMD_VEND2)
>  		ret = rtlgen_write_vend2(phydev, regnum, val);
>  	else if (devnum == MDIO_MMD_AN && regnum == MDIO_AN_EEE_ADV)
> -		ret = rtlgen_write_vend2(phydev, regnum, RTL_MDIO_AN_EEE_ADV);
> +		ret = rtlgen_write_vend2(phydev, RTL_MDIO_AN_EEE_ADV, val);
>  	else
>  		ret = -EOPNOTSUPP;

Reviewed-by: Nicolai Buchwitz <[email protected]>

Thanks,
Nicolai
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.