diff mbox series

eth: asix88179: reset during probe

Message ID 20240618145759.3296876-2-caleb.connolly@linaro.org
State New
Headers show
Series eth: asix88179: reset during probe | expand

Commit Message

Caleb Connolly June 18, 2024, 2:57 p.m. UTC
In some cases (consistently in my case with an embedded board) the
ethernet controller will time out on the first init but always succeed
after reset.

Let's reset the controller during probe so we always start with it in a
known state, and don't have wait for the first asix_wait_link() to
time out.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
I see this behaviour consistently across three Qualcomm platforms that use this
controller.
---
 drivers/usb/eth/asix88179.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Marek Vasut June 23, 2024, 4:34 a.m. UTC | #1
On 6/18/24 4:57 PM, Caleb Connolly wrote:
> In some cases (consistently in my case with an embedded board) the
> ethernet controller will time out on the first init but always succeed
> after reset.
> 
> Let's reset the controller during probe so we always start with it in a
> known state, and don't have wait for the first asix_wait_link() to
> time out.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

Reviewed-by: Marek Vasut <marex@denx.de>

Please let me know if you need me to pick this up via usb tree, even if 
this is kind-of a -net patch .

Thanks
diff mbox series

Patch

diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
index 7bfd285b3aa4..a0aa5c25e428 100644
--- a/drivers/usb/eth/asix88179.c
+++ b/drivers/usb/eth/asix88179.c
@@ -628,8 +628,14 @@  static int ax88179_eth_probe(struct udevice *dev)
 
 	usb_dev = priv->ueth.pusb_dev;
 	priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
 
+	ret = asix_basic_reset(&priv->ueth, priv);
+	if (ret) {
+		printf("Failed to reset ethernet device\n");
+		return ret;
+	}
+
 	/* Get the MAC address */
 	ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
 	if (ret)
 		return ret;