* [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
@ 2025-10-11 11:02 Marek Vasut
2025-10-13 9:36 ` Maxime Chevallier
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marek Vasut @ 2025-10-11 11:02 UTC (permalink / raw)
To: netdev
Cc: Marek Vasut, David S. Miller, Andrew Lunn, Daniel Golle,
Eric Dumazet, Heiner Kallweit, Jakub Kicinski, Markus Stockhausen,
Michael Klein, Paolo Abeni, Russell King
The driver is currently checking for PHYCR2 register presence in
rtl8211f_config_init(), but it does so after accessing PHYCR2 to
disable EEE. This was introduced in commit bfc17c165835 ("net:
phy: realtek: disable PHY-mode EEE"). Move the PHYCR2 presence
test before the EEE disablement and simplify the code.
Fixes: bfc17c165835 ("net: phy: realtek: disable PHY-mode EEE")
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
---
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Daniel Golle <daniel@makrotopia.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
Cc: Michael Klein <michael@fossekall.de>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org
---
drivers/net/phy/realtek/realtek_main.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index 82d8e1335215d..a724b21b4fe73 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -633,26 +633,25 @@ static int rtl8211f_config_init(struct phy_device *phydev)
str_enabled_disabled(val_rxdly));
}
+ if (!priv->has_phycr2)
+ return 0;
+
/* Disable PHY-mode EEE so LPI is passed to the MAC */
ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE, RTL8211F_PHYCR2,
RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
if (ret)
return ret;
- if (priv->has_phycr2) {
- ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE,
- RTL8211F_PHYCR2, RTL8211F_CLKOUT_EN,
- priv->phycr2);
- if (ret < 0) {
- dev_err(dev, "clkout configuration failed: %pe\n",
- ERR_PTR(ret));
- return ret;
- }
-
- return genphy_soft_reset(phydev);
+ ret = phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE,
+ RTL8211F_PHYCR2, RTL8211F_CLKOUT_EN,
+ priv->phycr2);
+ if (ret < 0) {
+ dev_err(dev, "clkout configuration failed: %pe\n",
+ ERR_PTR(ret));
+ return ret;
}
- return 0;
+ return genphy_soft_reset(phydev);
}
static int rtl821x_suspend(struct phy_device *phydev)
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
2025-10-11 11:02 [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present Marek Vasut
@ 2025-10-13 9:36 ` Maxime Chevallier
2025-10-13 12:35 ` Russell King (Oracle)
2025-10-14 1:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Maxime Chevallier @ 2025-10-13 9:36 UTC (permalink / raw)
To: Marek Vasut, netdev
Cc: David S. Miller, Andrew Lunn, Daniel Golle, Eric Dumazet,
Heiner Kallweit, Jakub Kicinski, Markus Stockhausen,
Michael Klein, Paolo Abeni, Russell King
Hi Marek,
On 11/10/2025 13:02, Marek Vasut wrote:
> The driver is currently checking for PHYCR2 register presence in
> rtl8211f_config_init(), but it does so after accessing PHYCR2 to
> disable EEE. This was introduced in commit bfc17c165835 ("net:
> phy: realtek: disable PHY-mode EEE"). Move the PHYCR2 presence
> test before the EEE disablement and simplify the code.
>
> Fixes: bfc17c165835 ("net: phy: realtek: disable PHY-mode EEE")
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
2025-10-11 11:02 [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present Marek Vasut
2025-10-13 9:36 ` Maxime Chevallier
@ 2025-10-13 12:35 ` Russell King (Oracle)
2025-10-14 1:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Russell King (Oracle) @ 2025-10-13 12:35 UTC (permalink / raw)
To: Marek Vasut
Cc: netdev, David S. Miller, Andrew Lunn, Daniel Golle, Eric Dumazet,
Heiner Kallweit, Jakub Kicinski, Markus Stockhausen,
Michael Klein, Paolo Abeni
On Sat, Oct 11, 2025 at 01:02:49PM +0200, Marek Vasut wrote:
> The driver is currently checking for PHYCR2 register presence in
> rtl8211f_config_init(), but it does so after accessing PHYCR2 to
> disable EEE. This was introduced in commit bfc17c165835 ("net:
> phy: realtek: disable PHY-mode EEE"). Move the PHYCR2 presence
> test before the EEE disablement and simplify the code.
>
> Fixes: bfc17c165835 ("net: phy: realtek: disable PHY-mode EEE")
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
This looks obvious.
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thanks!
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Daniel Golle <daniel@makrotopia.org>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
> Cc: Michael Klein <michael@fossekall.de>
> Cc: Paolo Abeni <pabeni@redhat.com>
> Cc: Russell King <linux@armlinux.org.uk>
Please drop this line.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
2025-10-11 11:02 [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present Marek Vasut
2025-10-13 9:36 ` Maxime Chevallier
2025-10-13 12:35 ` Russell King (Oracle)
@ 2025-10-14 1:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-14 1:10 UTC (permalink / raw)
To: Marek Vasut
Cc: netdev, davem, andrew, daniel, edumazet, hkallweit1, kuba,
markus.stockhausen, michael, pabeni, linux
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 11 Oct 2025 13:02:49 +0200 you wrote:
> The driver is currently checking for PHYCR2 register presence in
> rtl8211f_config_init(), but it does so after accessing PHYCR2 to
> disable EEE. This was introduced in commit bfc17c165835 ("net:
> phy: realtek: disable PHY-mode EEE"). Move the PHYCR2 presence
> test before the EEE disablement and simplify the code.
>
> Fixes: bfc17c165835 ("net: phy: realtek: disable PHY-mode EEE")
> Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
>
> [...]
Here is the summary with links:
- [net] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
https://git.kernel.org/netdev/net/c/2c67301584f2
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:[~2025-10-14 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-11 11:02 [net,PATCH] net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present Marek Vasut
2025-10-13 9:36 ` Maxime Chevallier
2025-10-13 12:35 ` Russell King (Oracle)
2025-10-14 1:10 ` 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;
as well as URLs for NNTP newsgroup(s).