Skip to contentSkip to conversation

net: axienet: Set mac_managed_pm

PATCH Applied Nick Hu 5 participants 7 messages Feb 17, 2025 – Feb 20, 2025

Subsystems (4)
lore
Share & tools
lore

Nick Hu

author
#0 lore raw

PATCH 1/1 net: axienet: Set mac_managed_pm

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -0
index 2ffaad0b0477..2deeb982bf6b 100644
@@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
 
 	lp->phylink_config.dev = &ndev->dev;
 	lp->phylink_config.type = PHYLINK_NETDEV;
+	lp->phylink_config.mac_managed_pm = true;
 	lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
 		MAC_10FD | MAC_100FD | MAC_1000FD;
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

On 2/16/2025 9:58 PM, Nick Hu wrote:
Nit: subject should include the "net" prefix since this is clearly a bug fix.

Quoted 9 lines

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Quoted 3 lines
Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")

---

Otherwise, the fix seems correct to me.

Quoted 15 lines
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -0
index 2ffaad0b0477..2deeb982bf6b 100644
@@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
 
 	lp->phylink_config.dev = &ndev->dev;
 	lp->phylink_config.type = PHYLINK_NETDEV;
+	lp->phylink_config.mac_managed_pm = true;
 	lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
 		MAC_10FD | MAC_100FD | MAC_1000FD;
 
author
#2 lore raw

Hi Jacob

Quoted 7 lines · Jacob Keller

On 2/16/2025 9:58 PM, Nick Hu wrote:
Nit: subject should include the "net" prefix since this is clearly a bug fix.

I've added the 'net' prefix to the subject 'net: axienet: Set mac_managed_pm'. Is there something I'm missing?

Quoted 26 lines
Quoted 9 lines

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Quoted 3 lines
Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")

---

Otherwise, the fix seems correct to me.

Quoted 9 lines
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -0
index 2ffaad0b0477..2deeb982bf6b 100644
@@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
 
Quoted 7 lines

drivers/net/ethernet/xilinx/xilinx_axienet_main.c static int axienet_probe(struct platform_device *pdev) · line 3084

Quoted 6 lines
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -0
      lp->phylink_config.dev = &ndev->dev;
      lp->phylink_config.type = PHYLINK_NETDEV;
+     lp->phylink_config.mac_managed_pm = true;
      lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
              MAC_10FD | MAC_100FD | MAC_1000FD;
 

Regards,
Nick

#3 lore raw
Quoted 6 lines · Nick Hu

Hi Jacob

Quoted 3 lines · Jacob Keller
Quoted 7 lines
Quoted 4 lines · Nick Hu

Nit: subject should include the "net" prefix since this is clearly a bug fix.

I've added the 'net' prefix to the subject 'net: axienet: Set mac_managed_pm'. Is there something I'm missing?

It should be [PATCH net] net: axienet: Set mac_managed_pm Like here for example [1]. You can look at netdev FAQ [2]. It is described there how to specify the subject.

Probably you don't need to resend it only because of that.

[1] https://lore.kernel.org/netdev/CAL+tcoC3TuZPTwnHTDvXC+JPoJbgW2UywZ2=xv=E=utokb3pCQ@mail.gmail.com/T/#m2b5603fbf355216ab035aa0f69c10c5f4ba98772
[2] https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Thanks,
Michal

Quoted 36 lines
Quoted 26 lines
Quoted 9 lines

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Quoted 3 lines
Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")

---

Otherwise, the fix seems correct to me.

Quoted 9 lines
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -0
index 2ffaad0b0477..2deeb982bf6b 100644
@@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
 
Quoted 7 lines

drivers/net/ethernet/xilinx/xilinx_axienet_main.c static int axienet_probe(struct platform_device *pdev) · line 3084

Quoted 6 lines
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -0
      lp->phylink_config.dev = &ndev->dev;
      lp->phylink_config.type = PHYLINK_NETDEV;
+     lp->phylink_config.mac_managed_pm = true;
      lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
              MAC_10FD | MAC_100FD | MAC_1000FD;
 

Regards,
Nick

author
#4 lore raw

Hi Michal

Thanks for the information! I'll pay attention next time.

Quoted 20 lines · Michal Swiatkowski
Quoted 6 lines · Nick Hu

Hi Jacob

Quoted 3 lines · Jacob Keller
Quoted 7 lines
Quoted 4 lines · Nick Hu

Nit: subject should include the "net" prefix since this is clearly a bug fix.

I've added the 'net' prefix to the subject 'net: axienet: Set mac_managed_pm'. Is there something I'm missing?

It should be [PATCH net] net: axienet: Set mac_managed_pm Like here for example [1]. You can look at netdev FAQ [2]. It is described there how to specify the subject.

Quoted 44 lines

Probably you don't need to resend it only because of that.

[1] https://lore.kernel.org/netdev/CAL+tcoC3TuZPTwnHTDvXC+JPoJbgW2UywZ2=xv=E=utokb3pCQ@mail.gmail.com/T/#m2b5603fbf355216ab035aa0f69c10c5f4ba98772
[2] https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt

Thanks,
Michal

Quoted 36 lines
Quoted 26 lines
Quoted 9 lines

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Quoted 3 lines
Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")

---

Otherwise, the fix seems correct to me.

Quoted 9 lines
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -0
index 2ffaad0b0477..2deeb982bf6b 100644
@@ -3078,6 +3078,7 @@ static int axienet_probe(struct platform_device *pdev)
 
Quoted 7 lines

drivers/net/ethernet/xilinx/xilinx_axienet_main.c static int axienet_probe(struct platform_device *pdev) · line 3084

Quoted 6 lines
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -0
      lp->phylink_config.dev = &ndev->dev;
      lp->phylink_config.type = PHYLINK_NETDEV;
+     lp->phylink_config.mac_managed_pm = true;
      lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE |
              MAC_10FD | MAC_100FD | MAC_1000FD;
 

Regards,
Nick

Regards,
Nick

#5 lore raw
In reply to Nick Hu
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Mon, 17 Feb 2025 13:58:42 +0800 you wrote:

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

[...]

Here is the summary with links:
- net: axienet: Set mac_managed_pm

    https://git.kernel.org/netdev/net/c/a370295367b5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
maintainer Applied
#6 lore raw
In reply to Nick Hu
Quoted 11 lines · On Mon, 17 Feb 2025 13:58:42 +0800 Nick Hu wrote:

The external PHY will undergo a soft reset twice during the resume process when it wake up from suspend. The first reset occurs when the axienet driver calls phylink_of_phy_connect(), and the second occurs when mdio_bus_phy_resume() invokes phy_init_hw(). The second soft reset of the external PHY does not reinitialize the internal PHY, which causes issues with the internal PHY, resulting in the PHY link being down. To prevent this, setting the mac_managed_pm flag skips the mdio_bus_phy_resume() function.

Fixes a129b41fe0a8 ("Revert "net: phy: dp83867: perform soft reset and retain established link"")

Applied, thanks!