All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 11:20 ` Guan Wentao
  0 siblings, 0 replies; 12+ messages in thread
From: Guan Wentao @ 2023-02-08 11:20 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu
  Cc: davem, edumazet, kuba, pabeni, mcoquelin.stm32, netdev,
	linux-stm32, linux-arm-kernel, Guan Wentao

The phy->interface from mdiobus_get_phy is default from phy_device_create.
In some phy devices like at803x, we need the correct value to init delay.
Use priv->plat->interface to init if we know.

Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a5b8dab5e9b..1dc9c7f3d714 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
 			return -ENODEV;
 		}
 
+		/* If we know the interface, it defines which PHY interface */
+		if (priv->plat->interface > 0) {
+			phydev->interface = priv->plat->interface;
+			netdev_dbg(priv->dev, "Override default phy interface\n");
+		}
+
 		ret = phylink_connect_phy(priv->phylink, phydev);
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 11:20 ` Guan Wentao
  0 siblings, 0 replies; 12+ messages in thread
From: Guan Wentao @ 2023-02-08 11:20 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu
  Cc: davem, edumazet, kuba, pabeni, mcoquelin.stm32, netdev,
	linux-stm32, linux-arm-kernel, Guan Wentao

The phy->interface from mdiobus_get_phy is default from phy_device_create.
In some phy devices like at803x, we need the correct value to init delay.
Use priv->plat->interface to init if we know.

Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a5b8dab5e9b..1dc9c7f3d714 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
 			return -ENODEV;
 		}
 
+		/* If we know the interface, it defines which PHY interface */
+		if (priv->plat->interface > 0) {
+			phydev->interface = priv->plat->interface;
+			netdev_dbg(priv->dev, "Override default phy interface\n");
+		}
+
 		ret = phylink_connect_phy(priv->phylink, phydev);
 	}
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
  2023-02-08 11:20 ` Guan Wentao
@ 2023-02-08 13:27   ` Andrew Lunn
  -1 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2023-02-08 13:27 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 07:20:54PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, we need the correct value to init delay.
> Use priv->plat->interface to init if we know.

You commit message i missing a lot of details to make this easy to
review.

So you board is not using DT? And so there is not a DT node specifying
the phy-mode. You have some other way of getting the correct interface
mode into plat->interface. And since you don't have DT, you also have
some other mechanism to set plat->phy_addr to the address on the MDIO
bus. The code then directly gets the PHY from the MDIO bus, and calls
phylink_connect_phy() to connect the PHY. The old code used
phy_connect() which took an interface parameter but
phylink_connect_phy() does not. And that is your problem.

So your fix makes sense.

Please improve the commit message.

Please also take a look at
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
You should set the email Subject: line to indicate which tree this
patch is for.

       Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 13:27   ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2023-02-08 13:27 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 07:20:54PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, we need the correct value to init delay.
> Use priv->plat->interface to init if we know.

You commit message i missing a lot of details to make this easy to
review.

So you board is not using DT? And so there is not a DT node specifying
the phy-mode. You have some other way of getting the correct interface
mode into plat->interface. And since you don't have DT, you also have
some other mechanism to set plat->phy_addr to the address on the MDIO
bus. The code then directly gets the PHY from the MDIO bus, and calls
phylink_connect_phy() to connect the PHY. The old code used
phy_connect() which took an interface parameter but
phylink_connect_phy() does not. And that is your problem.

So your fix makes sense.

Please improve the commit message.

Please also take a look at
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
You should set the email Subject: line to indicate which tree this
patch is for.

       Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
  2023-02-08 12:40 ` Guan Wentao
@ 2023-02-08 13:32   ` Russell King (Oracle)
  -1 siblings, 0 replies; 12+ messages in thread
From: Russell King (Oracle) @ 2023-02-08 13:32 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

[Not fully over covid but I spotted this and don't agree with this change]

On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, use phy->interface to init rgmii delay.
> Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> 
> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 1a5b8dab5e9b..debfcb045c22 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
>  			return -ENODEV;
>  		}
>  
> +		/* If we know the interface, it defines which PHY interface */
> +		if (priv->plat->phy_interface > 0) {
> +			phydev->interface = priv->plat->phy_interface;
> +			netdev_dbg(priv->dev, "Override default phy interface\n");
> +		}
> +

Why do you need to do this?

You call phylink_create() with ->phy_interface, which tells phylink
which interface you want to use. Then, phylink_connect_phy().

phylink will then call phylink_attach_phy() and then phy_attach_direct()
with the interface you asked for (which was ->phy_interface).

phy_attach_direct() will then set phydev->interface to that interface
mode.

So, I think what you have above is a hack rather than a proper fix,
and the real problem is elsewhere.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 13:32   ` Russell King (Oracle)
  0 siblings, 0 replies; 12+ messages in thread
From: Russell King (Oracle) @ 2023-02-08 13:32 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

[Not fully over covid but I spotted this and don't agree with this change]

On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, use phy->interface to init rgmii delay.
> Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> 
> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 1a5b8dab5e9b..debfcb045c22 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
>  			return -ENODEV;
>  		}
>  
> +		/* If we know the interface, it defines which PHY interface */
> +		if (priv->plat->phy_interface > 0) {
> +			phydev->interface = priv->plat->phy_interface;
> +			netdev_dbg(priv->dev, "Override default phy interface\n");
> +		}
> +

Why do you need to do this?

You call phylink_create() with ->phy_interface, which tells phylink
which interface you want to use. Then, phylink_connect_phy().

phylink will then call phylink_attach_phy() and then phy_attach_direct()
with the interface you asked for (which was ->phy_interface).

phy_attach_direct() will then set phydev->interface to that interface
mode.

So, I think what you have above is a hack rather than a proper fix,
and the real problem is elsewhere.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
  2023-02-08 13:11   ` Simon Horman
@ 2023-02-08 13:29     ` Andrew Lunn
  -1 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2023-02-08 13:29 UTC (permalink / raw)
  To: Simon Horman
  Cc: Guan Wentao, peppe.cavallaro, alexandre.torgue, joabreu, davem,
	edumazet, kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 02:11:52PM +0100, Simon Horman wrote:
> On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> > The phy->interface from mdiobus_get_phy is default from phy_device_create.
> > In some phy devices like at803x, use phy->interface to init rgmii delay.
> > Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> > 
> > Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> > Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> > ---
> 
> This is v2 of this patch, so let me make some comments about that.
> 
> * Firstly, unless asked to repost by a reviewer/maintainer,
>   it's generally bad practice to post a patch(set) more than once within 24h.

Hi Guan

I just showed you why there is this 24 hour rule by replying to your
first version...

      Andrew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 13:29     ` Andrew Lunn
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Lunn @ 2023-02-08 13:29 UTC (permalink / raw)
  To: Simon Horman
  Cc: Guan Wentao, peppe.cavallaro, alexandre.torgue, joabreu, davem,
	edumazet, kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 02:11:52PM +0100, Simon Horman wrote:
> On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> > The phy->interface from mdiobus_get_phy is default from phy_device_create.
> > In some phy devices like at803x, use phy->interface to init rgmii delay.
> > Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> > 
> > Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> > Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> > ---
> 
> This is v2 of this patch, so let me make some comments about that.
> 
> * Firstly, unless asked to repost by a reviewer/maintainer,
>   it's generally bad practice to post a patch(set) more than once within 24h.

Hi Guan

I just showed you why there is this 24 hour rule by replying to your
first version...

      Andrew

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
  2023-02-08 12:40 ` Guan Wentao
@ 2023-02-08 13:11   ` Simon Horman
  -1 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-02-08 13:11 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, use phy->interface to init rgmii delay.
> Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> 
> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> ---

This is v2 of this patch, so let me make some comments about that.

* Firstly, unless asked to repost by a reviewer/maintainer,
  it's generally bad practice to post a patch(set) more than once within 24h.

* If it is a networking but fix, then it should be targeted at the 'net' tree.
  Otherwise, networking patches should be targeted at the 'net-next' tree.
  In either case this should be noted in the subject.

  Also, v2 (and so on), should be noted in the subject.

  Something like this:

  [PATCH v2 net-next] net: stmmac: get phydev->interface from mac for mdio phy

* When posting revised patches, it's important to note what has changed.
  typically that goes below the scissors ('---').

  Something like this;

  v2:
  * Fixed blah
  * Updated foo

* Please read the FAQ
  https://kernel.org/doc/html/latest/process/maintainer-netdev.html

>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 1a5b8dab5e9b..debfcb045c22 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
>  			return -ENODEV;
>  		}
>  
> +		/* If we know the interface, it defines which PHY interface */
> +		if (priv->plat->phy_interface > 0) {
> +			phydev->interface = priv->plat->phy_interface;
> +			netdev_dbg(priv->dev, "Override default phy interface\n");
> +		}
> +
>  		ret = phylink_connect_phy(priv->phylink, phydev);
>  	}
>  
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 13:11   ` Simon Horman
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Horman @ 2023-02-08 13:11 UTC (permalink / raw)
  To: Guan Wentao
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet,
	kuba, pabeni, mcoquelin.stm32, netdev, linux-stm32,
	linux-arm-kernel

On Wed, Feb 08, 2023 at 08:40:25PM +0800, Guan Wentao wrote:
> The phy->interface from mdiobus_get_phy is default from phy_device_create.
> In some phy devices like at803x, use phy->interface to init rgmii delay.
> Use plat->phy_interface to init if know from stmmac_probe_config_dt.
> 
> Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
> Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
> ---

This is v2 of this patch, so let me make some comments about that.

* Firstly, unless asked to repost by a reviewer/maintainer,
  it's generally bad practice to post a patch(set) more than once within 24h.

* If it is a networking but fix, then it should be targeted at the 'net' tree.
  Otherwise, networking patches should be targeted at the 'net-next' tree.
  In either case this should be noted in the subject.

  Also, v2 (and so on), should be noted in the subject.

  Something like this:

  [PATCH v2 net-next] net: stmmac: get phydev->interface from mac for mdio phy

* When posting revised patches, it's important to note what has changed.
  typically that goes below the scissors ('---').

  Something like this;

  v2:
  * Fixed blah
  * Updated foo

* Please read the FAQ
  https://kernel.org/doc/html/latest/process/maintainer-netdev.html

>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index 1a5b8dab5e9b..debfcb045c22 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
>  			return -ENODEV;
>  		}
>  
> +		/* If we know the interface, it defines which PHY interface */
> +		if (priv->plat->phy_interface > 0) {
> +			phydev->interface = priv->plat->phy_interface;
> +			netdev_dbg(priv->dev, "Override default phy interface\n");
> +		}
> +
>  		ret = phylink_connect_phy(priv->phylink, phydev);
>  	}
>  
> -- 
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 12:40 ` Guan Wentao
  0 siblings, 0 replies; 12+ messages in thread
From: Guan Wentao @ 2023-02-08 12:40 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu
  Cc: davem, edumazet, kuba, pabeni, mcoquelin.stm32, netdev,
	linux-stm32, linux-arm-kernel, Guan Wentao

The phy->interface from mdiobus_get_phy is default from phy_device_create.
In some phy devices like at803x, use phy->interface to init rgmii delay.
Use plat->phy_interface to init if know from stmmac_probe_config_dt.

Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a5b8dab5e9b..debfcb045c22 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
 			return -ENODEV;
 		}
 
+		/* If we know the interface, it defines which PHY interface */
+		if (priv->plat->phy_interface > 0) {
+			phydev->interface = priv->plat->phy_interface;
+			netdev_dbg(priv->dev, "Override default phy interface\n");
+		}
+
 		ret = phylink_connect_phy(priv->phylink, phydev);
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init
@ 2023-02-08 12:40 ` Guan Wentao
  0 siblings, 0 replies; 12+ messages in thread
From: Guan Wentao @ 2023-02-08 12:40 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu
  Cc: davem, edumazet, kuba, pabeni, mcoquelin.stm32, netdev,
	linux-stm32, linux-arm-kernel, Guan Wentao

The phy->interface from mdiobus_get_phy is default from phy_device_create.
In some phy devices like at803x, use phy->interface to init rgmii delay.
Use plat->phy_interface to init if know from stmmac_probe_config_dt.

Fixes: 74371272f97f ("net: stmmac: Convert to phylink and remove phylib logic")
Signed-off-by: Guan Wentao <guanwentao@uniontech.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 1a5b8dab5e9b..debfcb045c22 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -1162,6 +1162,12 @@ static int stmmac_init_phy(struct net_device *dev)
 			return -ENODEV;
 		}
 
+		/* If we know the interface, it defines which PHY interface */
+		if (priv->plat->phy_interface > 0) {
+			phydev->interface = priv->plat->phy_interface;
+			netdev_dbg(priv->dev, "Override default phy interface\n");
+		}
+
 		ret = phylink_connect_phy(priv->phylink, phydev);
 	}
 
-- 
2.20.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-08 13:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 11:20 [PATCH] net: stmmac: get phydev->interface from mac for mdio phy init Guan Wentao
2023-02-08 11:20 ` Guan Wentao
2023-02-08 13:27 ` Andrew Lunn
2023-02-08 13:27   ` Andrew Lunn
2023-02-08 12:40 Guan Wentao
2023-02-08 12:40 ` Guan Wentao
2023-02-08 13:11 ` Simon Horman
2023-02-08 13:11   ` Simon Horman
2023-02-08 13:29   ` Andrew Lunn
2023-02-08 13:29     ` Andrew Lunn
2023-02-08 13:32 ` Russell King (Oracle)
2023-02-08 13:32   ` Russell King (Oracle)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.