Skip to contentSkip to conversation

net: phy: Do not do CL22 phy reset before ethernet phy driver probe

PATCH In review Sky Huang 4 participants 8 messages Oct 14, 2024 – Oct 26, 2025

Subsystems (2)
lore
Share & tools
lore

Sky Huang

author
#0 lore raw

PATCH 1/1 net: phy: Do not do CL22 phy reset before ethernet phy driver probe

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
 drivers/net/phy/phy.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -2
index 716a1d46111..e6fed8c41d7 100644
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
 static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
 			    phy_interface_t interface)
 {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
 	if (phydev->dev && phydev->dev != dev) {
 		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
 		       phydev->bus->name, phydev->addr,
Signature · 1 line
2.45.2
#1 lore raw
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
  drivers/net/phy/phy.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
  static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
  			    phy_interface_t interface)
  {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
  	if (phydev->dev && phydev->dev != dev) {
  		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
  		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Which PHY is affected by this ?

#2 lore raw

Hi,

Quoted 29 lines · Marek Vasut
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
  drivers/net/phy/phy.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
  static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
  			    phy_interface_t interface)
  {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
  	if (phydev->dev && phydev->dev != dev) {
  		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
  		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Quoted 1 line

Which PHY is affected by this ?

Good hunch. I just bisected down to this commit as I had some issues with my Allwinner V3 board using the internal CL22 PHY. The symptom is that the LEDS's polarity was inverted. Network still seems to work (although not tested beyond ping).

This change can have very significant consequences in general, which were not explored at all in the commit. This may break many boards that do rely on that PHY reset, in various scenarios and for various reasons.

I think it should be reverted as soon as possible to restore previous behavior.

All the best,

Paul

Signature · 6 lines
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.
#3 lore raw
Quoted 39 lines · Paul Kocialkowski

Hi,

Quoted 29 lines · Marek Vasut
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
  drivers/net/phy/phy.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
  static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
  			    phy_interface_t interface)
  {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
  	if (phydev->dev && phydev->dev != dev) {
  		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
  		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Quoted 1 line

Which PHY is affected by this ?

Good hunch. I just bisected down to this commit as I had some issues with my Allwinner V3 board using the internal CL22 PHY. The symptom is that the LEDS's polarity was inverted. Network still seems to work (although not tested beyond ping).

Quoted 5 lines

This change can have very significant consequences in general, which were not explored at all in the commit. This may break many boards that do rely on that PHY reset, in various scenarios and for various reasons.

I think it should be reverted as soon as possible to restore previous behavior.

I'm wondering if anyone has further comments here? If I do go and revert this what is then going to break on the MediaTek side for example?

Signature · 1 line
Tom
#4 lore raw
Quoted 40 lines · Tom Rini
Quoted 39 lines · Paul Kocialkowski

Hi,

Quoted 29 lines · Marek Vasut
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
   drivers/net/phy/phy.c | 2 --
   1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
   static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
   			    phy_interface_t interface)
   {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
   	if (phydev->dev && phydev->dev != dev) {
   		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
   		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Quoted 1 line

Which PHY is affected by this ?

Good hunch. I just bisected down to this commit as I had some issues with my Allwinner V3 board using the internal CL22 PHY. The symptom is that the LEDS's polarity was inverted. Network still seems to work (although not tested beyond ping).

Quoted 8 lines
Quoted 5 lines

This change can have very significant consequences in general, which were not explored at all in the commit. This may break many boards that do rely on that PHY reset, in various scenarios and for various reasons.

I think it should be reverted as soon as possible to restore previous behavior.

I'm wondering if anyone has further comments here? If I do go and revert this what is then going to break on the MediaTek side for example?

Let's revert it, and if MTK stuff breaks, let's fix it properly then.

#5 lore raw

Hi,

Quoted 45 lines · Marek Vasut
Quoted 44 lines · Tom Rini
Quoted 43 lines · Paul Kocialkowski

Hi,

Quoted 29 lines · Marek Vasut
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
   drivers/net/phy/phy.c | 2 --
   1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
   static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
   			    phy_interface_t interface)
   {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
   	if (phydev->dev && phydev->dev != dev) {
   		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
   		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Quoted 1 line

Which PHY is affected by this ?

Good hunch. I just bisected down to this commit as I had some issues with my Allwinner V3 board using the internal CL22 PHY. The symptom is that the LEDS's polarity was inverted. Network still seems to work (although not tested beyond ping).

This change can have very significant consequences in general, which were not explored at all in the commit. This may break many boards that do rely on that PHY reset, in various scenarios and for various reasons.

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

I think it should be reverted as soon as possible to restore previous behavior.

I'm wondering if anyone has further comments here? If I do go and revert this what is then going to break on the MediaTek side for example?

Let's revert it, and if MTK stuff breaks, let's fix it properly then.

Agreed, keeping it only saves one setup but sacrifices many others. This is definitely not right.

An immediate solution to support Mediatek would be to add a config option (enabled by default) for the PHY reset. Or maybe this could be described in the board file somehow (this is a policy decision so I don't think any approach based on device-tree would be relevant here).

All the best,

Paul

Signature · 6 lines
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.
#6 lore raw
Quoted 54 lines · Paul Kocialkowski

Hi,

Quoted 45 lines · Marek Vasut
Quoted 44 lines · Tom Rini
Quoted 43 lines · Paul Kocialkowski

Hi,

Quoted 29 lines · Marek Vasut
Quoted 16 lines · Sky Huang

From: "SkyLake.Huang" <[email protected]>

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

---
   drivers/net/phy/phy.c | 2 --
   1 file changed, 2 deletions(-)
drivers/net/phy/phy.c +0 -0
index 716a1d46111..e6fed8c41d7 100644

drivers/net/phy/phy.c struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask) · line 844

Quoted 8 lines
drivers/net/phy/phy.c +0 -2
@@ -839,8 +839,6 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, uint phy_mask)
   static void phy_connect_dev(struct phy_device *phydev, struct udevice *dev,
   			    phy_interface_t interface)
   {
-	/* Soft Reset the PHY */
-	phy_reset(phydev);
   	if (phydev->dev && phydev->dev != dev) {
   		printf("%s:%d is connected to %s.  Reconnecting to %s\n",
   		       phydev->bus->name, phydev->addr,

This needs clarification and likely has to be handled differently. Removing the reset would leave the PHY in potentially undefined state.

Quoted 1 line

Which PHY is affected by this ?

Good hunch. I just bisected down to this commit as I had some issues with my Allwinner V3 board using the internal CL22 PHY. The symptom is that the LEDS's polarity was inverted. Network still seems to work (although not tested beyond ping).

This change can have very significant consequences in general, which were not explored at all in the commit. This may break many boards that do rely on that PHY reset, in various scenarios and for various reasons.

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

I think it should be reverted as soon as possible to restore previous behavior.

I'm wondering if anyone has further comments here? If I do go and revert this what is then going to break on the MediaTek side for example?

Let's revert it, and if MTK stuff breaks, let's fix it properly then.

Quoted 7 lines

Agreed, keeping it only saves one setup but sacrifices many others. This is definitely not right.

An immediate solution to support Mediatek would be to add a config option (enabled by default) for the PHY reset. Or maybe this could be described in the board file somehow (this is a policy decision so I don't think any approach based on device-tree would be relevant here).

OK, can you please post the revert and cc the MediaTek people, explaining what you ran in to? Thanks!

Signature · 1 line
Tom
#7 lore raw
In reply to Sky Huang
Quoted 5 lines · Sky Huang

Remove unnecessary CL22 phy reset before ethernet phy driver probe. Lots of ethernet phys requires driver to load firmware. Before that, CL22 phy reset may lead to malfunction.

Applied to u-boot/next, thanks!

[1/1] net: phy: Do not do CL22 phy reset before ethernet phy driver probe

      commit: bab54f5942c428be698216224fd10b91d974d4da
Signature · 1 line
Tom