Skip to contentSkip to conversation

net: phy: mxl-gpy: fix bogus error on USXGMII and integrated PHY

PATCH Applied Daniel Golle 4 participants 4 messages Nov 20, 2025 – Nov 22, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: mxl-gpy: fix bogus error on USXGMII and integrated PHY

As the interface mode doesn't need to be updated on PHYs connected with USXGMII and integrated PHYs, gpy_update_interface() should just return 0 in these cases rather than -EINVAL which has wrongly been introduced by commit 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type"), as this breaks support for those PHYs.

Fixes 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type")
---
 drivers/net/phy/mxl-gpy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mxl-gpy.c +1 -1
index 0daf0e86844a0..0058284b08f3b 100644
@@ -541,7 +541,7 @@ static int gpy_update_interface(struct phy_device *phydev)
 	/* Interface mode is fixed for USXGMII and integrated PHY */
 	if (phydev->interface == PHY_INTERFACE_MODE_USXGMII ||
 	    phydev->interface == PHY_INTERFACE_MODE_INTERNAL)
-		return -EINVAL;
+		return 0;
 
 	/* Automatically switch SERDES interface between SGMII and 2500-BaseX
 	 * according to speed. Disable ANEG in 2500-BaseX mode.
Signature · 1 line
2.51.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Daniel Golle

As the interface mode doesn't need to be updated on PHYs connected with USXGMII and integrated PHYs, gpy_update_interface() should just return 0 in these cases rather than -EINVAL which has wrongly been introduced by commit 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type"), as this breaks support for those PHYs.

Fixes 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type")

That looks correct indeed :)

Maxime

Quoted 17 lines
---
 drivers/net/phy/mxl-gpy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/mxl-gpy.c +1 -1
index 0daf0e86844a0..0058284b08f3b 100644
@@ -541,7 +541,7 @@ static int gpy_update_interface(struct phy_device *phydev)
 	/* Interface mode is fixed for USXGMII and integrated PHY */
 	if (phydev->interface == PHY_INTERFACE_MODE_USXGMII ||
 	    phydev->interface == PHY_INTERFACE_MODE_INTERNAL)
-		return -EINVAL;
+		return 0;
 
 	/* Automatically switch SERDES interface between SGMII and 2500-BaseX
 	 * according to speed. Disable ANEG in 2500-BaseX mode.
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Golle
Quoted 5 lines · Daniel Golle

As the interface mode doesn't need to be updated on PHYs connected with USXGMII and integrated PHYs, gpy_update_interface() should just return 0 in these cases rather than -EINVAL which has wrongly been introduced by commit 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type"), as this breaks support for those PHYs.

I think there's more problems here. gpy_update_interface() does more than just updating the interface, it also reads the master/slave and mdix state at the end of the function. Returning early for interfaces we don't means that we don't wish to update the interface for means these don't get read. Since these are media-side and are irrespective of the host-side interface, this seems buggy.

So, while this patch is correct, I think it would make sense to also fix the other problems here.

Thanks!

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
#3 lore raw
In reply to Daniel Golle
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 20 Nov 2025 14:17:13 +0000 you wrote:

As the interface mode doesn't need to be updated on PHYs connected with USXGMII and integrated PHYs, gpy_update_interface() should just return 0 in these cases rather than -EINVAL which has wrongly been introduced by commit 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type"), as this breaks support for those PHYs.

Fixes 7a495dde27ebc ("net: phy: mxl-gpy: Change gpy_update_interface() function return type")

[...]

Here is the summary with links:
- [net] net: phy: mxl-gpy: fix bogus error on USXGMII and integrated PHY

    https://git.kernel.org/netdev/net/c/ec3803b5917b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html