mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v1] net: dsa: wait until PHY aneg is done
@ 2022-04-27  7:33 Oleksij Rempel
  2022-04-29  7:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2022-04-27  7:33 UTC (permalink / raw)
  To: barebox; +Cc: Oleksij Rempel

Some PHYs need a bit longer to complete auto negotiation. So, wait long
enough until this process is done.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c
index f2420d306f..d9e629cefc 100644
--- a/drivers/net/dsa.c
+++ b/drivers/net/dsa.c
@@ -111,6 +111,10 @@ static int dsa_port_start(struct eth_device *edev)
 
 	dsa_port_set_ethaddr(edev);
 
+	ret = phy_wait_aneg_done(dp->edev.phydev);
+	if (ret)
+		return ret;
+
 	if (ops->port_enable) {
 		ret = ops->port_enable(dp, dp->index, dp->edev.phydev);
 		if (ret)
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH v1] net: dsa: wait until PHY aneg is done
  2022-04-27  7:33 [PATCH v1] net: dsa: wait until PHY aneg is done Oleksij Rempel
@ 2022-04-29  7:17 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-04-29  7:17 UTC (permalink / raw)
  To: Oleksij Rempel; +Cc: barebox

On Wed, Apr 27, 2022 at 09:33:40AM +0200, Oleksij Rempel wrote:
> Some PHYs need a bit longer to complete auto negotiation. So, wait long
> enough until this process is done.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/dsa.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks

Sascha


> 
> diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c
> index f2420d306f..d9e629cefc 100644
> --- a/drivers/net/dsa.c
> +++ b/drivers/net/dsa.c
> @@ -111,6 +111,10 @@ static int dsa_port_start(struct eth_device *edev)
>  
>  	dsa_port_set_ethaddr(edev);
>  
> +	ret = phy_wait_aneg_done(dp->edev.phydev);
> +	if (ret)
> +		return ret;
> +
>  	if (ops->port_enable) {
>  		ret = ops->port_enable(dp, dp->index, dp->edev.phydev);
>  		if (ret)
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2022-04-29  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27  7:33 [PATCH v1] net: dsa: wait until PHY aneg is done Oleksij Rempel
2022-04-29  7:17 ` Sascha Hauer

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git