2022-02-09 15:23:15

by Qingfang Deng

[permalink] [raw]
Subject: [PATCH net] 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.

Reported-by: Hauke Mehrtens <[email protected]>
Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
Signed-off-by: DENG Qingfang <[email protected]>
---
drivers/net/phy/mediatek-ge.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/phy/mediatek-ge.c b/drivers/net/phy/mediatek-ge.c
index b7a5ae20edd5..68ee434f9dea 100644
--- a/drivers/net/phy/mediatek-ge.c
+++ b/drivers/net/phy/mediatek-ge.c
@@ -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 */
--
2.25.1



2022-02-09 15:56:12

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH net] net: phy: mediatek: remove PHY mode check on MT7531

On 09/02/2022 17:39, DENG Qingfang 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.
>
> Reported-by: Hauke Mehrtens <[email protected]>
> Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
> Signed-off-by: DENG Qingfang <[email protected]>
> ---
> drivers/net/phy/mediatek-ge.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/phy/mediatek-ge.c b/drivers/net/phy/mediatek-ge.c
> index b7a5ae20edd5..68ee434f9dea 100644
> --- a/drivers/net/phy/mediatek-ge.c
> +++ b/drivers/net/phy/mediatek-ge.c
> @@ -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!

Acked-by: Arınç ÜNAL <[email protected]>

Cheers.
Arınç

2022-02-09 23:36:09

by Hauke Mehrtens

[permalink] [raw]
Subject: Re: [PATCH net] net: phy: mediatek: remove PHY mode check on MT7531

On 2/9/22 15:39, DENG Qingfang 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.
>
> Reported-by: Hauke Mehrtens <[email protected]>
> Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
> Signed-off-by: DENG Qingfang <[email protected]>

Tested-by: Hauke Mehrtens <[email protected]>

> ---
> drivers/net/phy/mediatek-ge.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/phy/mediatek-ge.c b/drivers/net/phy/mediatek-ge.c
> index b7a5ae20edd5..68ee434f9dea 100644
> --- a/drivers/net/phy/mediatek-ge.c
> +++ b/drivers/net/phy/mediatek-ge.c
> @@ -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 */


2022-02-15 15:37:59

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net] net: phy: mediatek: remove PHY mode check on MT7531

Hello:

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

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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html