Netdev List
 help / color / mirror / Atom feed
* [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
@ 2026-08-06 13:47 Oleksij Rempel
  2026-08-06 14:07 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Oleksij Rempel @ 2026-08-06 13:47 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: Oleksij Rempel, kernel, linux-kernel, Russell King, netdev

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 <o.rempel@pengutronix.de>
---
 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;
 
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
  2026-08-06 13:47 [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path Oleksij Rempel
@ 2026-08-06 14:07 ` Andrew Lunn
  2026-08-10 11:30 ` Nicolai Buchwitz
  2026-08-10 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2026-08-06 14:07 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Heiner Kallweit, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, kernel, linux-kernel, Russell King, netdev

On Thu, Aug 06, 2026 at 03:47:16PM +0200, 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 <o.rempel@pengutronix.de>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
  2026-08-06 13:47 [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path Oleksij Rempel
  2026-08-06 14:07 ` Andrew Lunn
@ 2026-08-10 11:30 ` Nicolai Buchwitz
  2026-08-10 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Buchwitz @ 2026-08-10 11:30 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, kernel, linux-kernel, Russell King,
	netdev

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 <o.rempel@pengutronix.de>
> ---
>  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 <nb@tipi-net.de>

Thanks,
Nicolai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
  2026-08-06 13:47 [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path Oleksij Rempel
  2026-08-06 14:07 ` Andrew Lunn
  2026-08-10 11:30 ` Nicolai Buchwitz
@ 2026-08-10 23:20 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-10 23:20 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: andrew, hkallweit1, davem, edumazet, kuba, pabeni, kernel,
	linux-kernel, linux, netdev

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  6 Aug 2026 15:47:16 +0200 you 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.
> 
> [...]

Here is the summary with links:
  - [net,v1,1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path
    https://git.kernel.org/netdev/net/c/202fef9bbbf5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-10 23:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 13:47 [PATCH net v1 1/1] net: phy: realtek: fix EEE advertisement write on the internal PHY MMD path Oleksij Rempel
2026-08-06 14:07 ` Andrew Lunn
2026-08-10 11:30 ` Nicolai Buchwitz
2026-08-10 23:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox