Skip to contentSkip to conversation

net: macb: Specify PHY PM management done by MAC

PATCH Applied Sergiu Moga 4 participants 4 messages Oct 19, 2022 – Oct 21, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: macb: Specify PHY PM management done by MAC

The macb_resume/macb_suspend methods already call the phylink_start/phylink_stop methods during their execution so explicitly say that the PM of the PHY is done by MAC by using the mac_managed_pm flag of the struct phylink_config.

This also fixes the warning message issued during resume:

WARNING: CPU: 0 PID: 237 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0x144/0x148

Depends-on: 96de900ae78e ("net: phylink: add mac_managed_pm in phylink_config structure")

Fixes 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")

---

v1 -> v2:
- Add Depends-on: tag

 drivers/net/ethernet/cadence/macb_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/cadence/macb_main.c +1 -0
index 51c9fd6f68a4..4f63f1ba3161 100644
@@ -806,6 +806,7 @@ static int macb_mii_probe(struct net_device *dev)
 
 	bp->phylink_config.dev = &dev->dev;
 	bp->phylink_config.type = PHYLINK_NETDEV;
+	bp->phylink_config.mac_managed_pm = true;
 
 	if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) {
 		bp->phylink_config.poll_fixed_state = true;
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Sergiu Moga

The macb_resume/macb_suspend methods already call the phylink_start/phylink_stop methods during their execution so explicitly say that the PM of the PHY is done by MAC by using the mac_managed_pm flag of the struct phylink_config.

This also fixes the warning message issued during resume:

WARNING: CPU: 0 PID: 237 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0x144/0x148

Depends-on: 96de900ae78e ("net: phylink: add mac_managed_pm in phylink_config structure")

Fixes 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")

Makes me realize we need to do the same in DSA, I will cook a patch soon.

Signature · 1 line
Florian
Reviewed-by on v2 1/1
#2 lore raw
In reply to Sergiu Moga
Quoted 11 lines · Sergiu Moga

The macb_resume/macb_suspend methods already call the phylink_start/phylink_stop methods during their execution so explicitly say that the PM of the PHY is done by MAC by using the mac_managed_pm flag of the struct phylink_config.

This also fixes the warning message issued during resume:

WARNING: CPU: 0 PID: 237 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0x144/0x148

Depends-on: 96de900ae78e ("net: phylink: add mac_managed_pm in phylink_config structure")

Fixes 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
Quoted 22 lines

---

v1 -> v2:
- Add Depends-on: tag

 drivers/net/ethernet/cadence/macb_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/cadence/macb_main.c +1 -0
index 51c9fd6f68a4..4f63f1ba3161 100644
@@ -806,6 +806,7 @@ static int macb_mii_probe(struct net_device *dev)
 
 	bp->phylink_config.dev = &dev->dev;
 	bp->phylink_config.type = PHYLINK_NETDEV;
+	bp->phylink_config.mac_managed_pm = true;
 
 	if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) {
 		bp->phylink_config.poll_fixed_state = true;
#3 lore raw
In reply to Sergiu Moga
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 19 Oct 2022 15:09:32 +0300 you wrote:

The macb_resume/macb_suspend methods already call the phylink_start/phylink_stop methods during their execution so explicitly say that the PM of the PHY is done by MAC by using the mac_managed_pm flag of the struct phylink_config.

This also fixes the warning message issued during resume:

WARNING: CPU: 0 PID: 237 at drivers/net/phy/phy_device.c:323 mdio_bus_phy_resume+0x144/0x148

[...]

Here is the summary with links:
- [v2] net: macb: Specify PHY PM management done by MAC

    https://git.kernel.org/netdev/net/c/15a9dbec631c

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html