Skip to contentSkip to conversation

net: phy: mediatek: remove PHY mode check on MT7531

PATCH Applied DENG Qingfang 5 participants 6 messages Feb 9, 2022 – Feb 15, 2022

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

PATCH 1/1 net: phy: mediatek: remove PHY mode check on MT7531

The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization:

mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL

Remove the check to make it work again.

Fixes e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
---
 drivers/net/phy/mediatek-ge.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/phy/mediatek-ge.c +0 -3
index b7a5ae20edd5..68ee434f9dea 100644
@@ -55,9 +55,6 @@ static int mt7530_phy_config_init(struct phy_device *phydev)
 
 static int mt7531_phy_config_init(struct phy_device *phydev)
 {
-	if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
-		return -EINVAL;
-
 	mtk_gephy_config_init(phydev);
 
 	/* PHY link down power saving enable */
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines · DENG Qingfang

The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization:

mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL

Remove the check to make it work again.

Fixes e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
---
  drivers/net/phy/mediatek-ge.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/net/phy/mediatek-ge.c +0 -0
index b7a5ae20edd5..68ee434f9dea 100644

drivers/net/phy/mediatek-ge.c static int mt7530_phy_config_init(struct phy_device *phydev) · line 60

Quoted 9 lines
drivers/net/phy/mediatek-ge.c +0 -3
@@ -55,9 +55,6 @@ static int mt7530_phy_config_init(struct phy_device *phydev)
 
  static int mt7531_phy_config_init(struct phy_device *phydev)
  {
-	if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
-		return -EINVAL;
-
  	mtk_gephy_config_init(phydev);
 
  	/* PHY link down power saving enable */

Thanks for submitting this!

Cheers.
Arınç

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer
#2 lore raw
In reply to DENG Qingfang
Quoted 3 lines · DENG Qingfang

The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization:

Is the PHY actually internal? If so PHY_INTERFACE_MODE_INTERNAL would be correct.

Are you fixing the wrong thing here?

Andrew

Tested-by on v1 1/1
#4 lore raw
In reply to DENG Qingfang
Quoted 11 lines · DENG Qingfang

The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization:

mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL

Remove the check to make it work again.

Fixes e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
Quoted 18 lines
---
  drivers/net/phy/mediatek-ge.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/net/phy/mediatek-ge.c +0 -3
index b7a5ae20edd5..68ee434f9dea 100644
@@ -55,9 +55,6 @@ static int mt7530_phy_config_init(struct phy_device *phydev)
 
  static int mt7531_phy_config_init(struct phy_device *phydev)
  {
-	if (phydev->interface != PHY_INTERFACE_MODE_INTERNAL)
-		return -EINVAL;
-
  	mtk_gephy_config_init(phydev);
 
  	/* PHY link down power saving enable */
#3 lore raw
In reply to Andrew Lunn
Quoted 3 lines · Andrew Lunn

Is the PHY actually internal? If so PHY_INTERFACE_MODE_INTERNAL would be correct.

I have no idea. Maybe it internally connects to the MAC with GMII. Add CC to mt7530 maintainers.

Quoted 4 lines

Are you fixing the wrong thing here?

Andrew

#5 lore raw
In reply to DENG Qingfang
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:

Quoted 9 lines · On Wed, 9 Feb 2022 22:39:47 +0800 you wrote:

The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization:

mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL

Remove the check to make it work again.

[...]

Here is the summary with links:
- [net] net: phy: mediatek: remove PHY mode check on MT7531

    https://git.kernel.org/netdev/net/c/525b108e6d95

You are awesome, thank you!

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