Skip to contentSkip to conversation

eth: asix88179: reset during probe

PATCH Applied Caleb Connolly 3 participants 6 messages Jun 18, 2024 – Jul 13, 2024 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eth: asix88179: reset during probe

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.

---
I see this behaviour consistently across three Qualcomm platforms that use this controller.

---
 drivers/usb/eth/asix88179.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/eth/asix88179.c +6 -0
index 7bfd285b3aa4..a0aa5c25e428 100644
@@ -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;
Signature · 1 line
2.45.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Caleb Connolly

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.

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Caleb Connolly

Hi Caleb,

Thank you for the patch.

Quoted 9 lines · Caleb Connolly

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.

Quoted 28 lines

---
I see this behaviour consistently across three Qualcomm platforms that use this controller.

---
 drivers/usb/eth/asix88179.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/eth/asix88179.c +6 -0
index 7bfd285b3aa4..a0aa5c25e428 100644
@@ -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;
Signature · 1 line
2.45.0
#3 lore raw
Quoted 1 line · Mattijs Korpershoek

Hi Caleb,

Hi,

Quoted 8 lines

Thank you for the patch.

Quoted 4 lines · Caleb Connolly

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.

Quoted 14 lines
Quoted 5 lines

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.

Quoted 6 lines

---
I see this behaviour consistently across three Qualcomm platforms that use this controller.

---
  drivers/usb/eth/asix88179.c | 6 ++++++
  1 file changed, 6 insertions(+)

Do you want to pick it via usb-gadget tree or shall I pick it via usb tree ?

#4 lore raw

Hi Marek,

Quoted 21 lines · Marek Vasut
Quoted 1 line · Mattijs Korpershoek

Hi Caleb,

Hi,

Quoted 16 lines

Thank you for the patch.

Quoted 9 lines · Caleb Connolly

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.

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

---
I see this behaviour consistently across three Qualcomm platforms that use this controller.

---
  drivers/usb/eth/asix88179.c | 6 ++++++
  1 file changed, 6 insertions(+)

Do you want to pick it via usb-gadget tree or shall I pick it via usb tree ?

According to get_maintainer.pl, it should be you :)

./scripts/get_maintainer.pl -- drivers/usb/eth/asix88179.c
Marek Vasut <[email protected]> (maintainer:USB)
Tom Rini <[email protected]> (maintainer:THE REST,authored:3/3=100%,added_lines:1/1=100%,removed_lines:2/2=100%) Mattijs Korpershoek <[email protected]> (commit_signer:1/3=33%)
[email protected] (open list)

If you are okay with that, please pick it up.

Thanks!
Mattijs

Applied
#5 lore raw
Quoted 32 lines · Mattijs Korpershoek

Hi Marek,

Quoted 28 lines · Marek Vasut
Quoted 1 line · Mattijs Korpershoek

Hi Caleb,

Hi,

Quoted 22 lines

Thank you for the patch.

Quoted 9 lines · Caleb Connolly

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.

Quoted 6 lines

---
I see this behaviour consistently across three Qualcomm platforms that use this controller.

---
   drivers/usb/eth/asix88179.c | 6 ++++++
   1 file changed, 6 insertions(+)
Quoted 3 lines
Quoted 1 line

Do you want to pick it via usb-gadget tree or shall I pick it via usb tree ?

According to get_maintainer.pl, it should be you :)

Applied to usb/master, thanks !