diff mbox series

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

Message ID 20220209143948.445823-1-dqfext@gmail.com (mailing list archive)
State Accepted
Commit 525b108e6d95b643eccbd84fb10aa9aa101b18dd
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phy: mediatek: remove PHY mode check on MT7531 | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Qingfang Deng Feb. 9, 2022, 2:39 p.m. UTC
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 <hauke@hauke-m.de>
Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
 drivers/net/phy/mediatek-ge.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Arınç ÜNAL Feb. 9, 2022, 2:47 p.m. UTC | #1
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 <hauke@hauke-m.de>
> Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
> Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> ---
>   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 <arinc.unal@arinc9.com>

Cheers.
Arınç
Andrew Lunn Feb. 9, 2022, 3:53 p.m. UTC | #2
On Wed, Feb 09, 2022 at 10:39:47PM +0800, 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:

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

Are you fixing the wrong thing here?

    Andrew
Hauke Mehrtens Feb. 9, 2022, 10:11 p.m. UTC | #3
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 <hauke@hauke-m.de>
> Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver")
> Signed-off-by: DENG Qingfang <dqfext@gmail.com>

Tested-by: Hauke Mehrtens <hauke@hauke-m.de>

> ---
>   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 */
Qingfang Deng Feb. 11, 2022, 1:24 a.m. UTC | #4
On Wed, Feb 9, 2022 at 11:53 PM Andrew Lunn <andrew@lunn.ch> wrote:
>
> 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.

>
> Are you fixing the wrong thing here?
>
>     Andrew
patchwork-bot+netdevbpf@kernel.org Feb. 15, 2022, 2:30 p.m. UTC | #5
Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

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!
diff mbox series

Patch

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 */