net: macb: Specify PHY PM management done by MAC

Message ID 20221019095548.57650-1-sergiu.moga@microchip.com
State New
Headers
Series net: macb: Specify PHY PM management done by MAC |

Commit Message

Sergiu Moga Oct. 19, 2022, 9:55 a.m. UTC
  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

Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Russell King (Oracle) Oct. 19, 2022, 12:01 p.m. UTC | #1
On Wed, Oct 19, 2022 at 12:55:50PM +0300, Sergiu Moga 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
> 
> Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")

Hi,

You also need to mention that this commit depends on 96de900ae78e
in the net tree, which introduced the mac_managed_pm member to
phylink_config.

Thanks.
  

Patch

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 51c9fd6f68a4..4f63f1ba3161 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -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;